Implements essentionally a one to one wiring with feedback connections. More...
#include <feedbackwiring.h>
Inherits AbstractWiring.

Public Types | |
| enum | Mode { Motor = 1, Context = 2, All = 3 } |
Public Member Functions | |
| FeedbackWiring (NoiseGenerator *noise, Mode mode=Context, double feedbackratio=0.9, const std::string &name="FeedBackWiring") | |
| constructor | |
| virtual | ~FeedbackWiring () |
| virtual std::list< iparamkey > | getInternalParamNames () const |
| The list of the names of all internal parameters given by getInternalParams(). | |
| virtual std::list< iparamval > | getInternalParams () const |
| virtual matrix::Matrix | getFeedbackRatio () const |
| return the feedback ratio vector | |
| virtual void | setFeedbackRatio (const matrix::Matrix &) |
| sets the feedback ratio vector. | |
Protected Member Functions | |
| virtual bool | initIntern () |
| to be overloaded by subclasses The rsensornumber and rmotornumber are already stored in the member variables. | |
| virtual bool | wireSensorsIntern (const sensor *rsensors, int rsensornumber, sensor *csensors, int csensornumber, double noise) |
| to be overloaded by subclasses | |
| virtual bool | wireMotorsIntern (motor *rmotors, int rmotornumber, const motor *cmotors, int cmotornumber) |
| to be overloaded by subclasses | |
Protected Attributes | |
| Mode | mode |
| double | defaultfeedbackratio |
| matrix::Matrix | feedbackratio |
| motor * | motors |
| array that stored the values of the motors | |
| int | vmotornumber |
Implements essentionally a one to one wiring with feedback connections.
The feedback connections from output to input are parameterised with a feedback strength. It is possible to generate virtual motors for context sensors.
In order to change the feedback strength after initialisation use the following code
matrix::Matrix rs = wiring->getFeedbackRatio(); double c=ratio; rs.toMapP(&c,constant); wiring->setFeedbackRatio(rs);
| enum Mode |
| FeedbackWiring | ( | NoiseGenerator * | noise, | |
| Mode | mode = Context, |
|||
| double | feedbackratio = 0.9, |
|||
| const std::string & | name = "FeedBackWiring" | |||
| ) |
constructor
| noise | NoiseGenerator that is used for adding noise to sensor values | |
| mode | Motor|Context|All: Motor: motor outputs send feedback; Context: virtual motor outputs for each context sensor with feedback | |
| feedbackratio | default ratio used to feed back the output to the input, meaning
|
| ~FeedbackWiring | ( | ) | [virtual] |
| matrix::Matrix getFeedbackRatio | ( | ) | const [virtual] |
return the feedback ratio vector
| Inspectable::iparamkeylist getInternalParamNames | ( | ) | const [virtual] |
The list of the names of all internal parameters given by getInternalParams().
The naming convention is "v[i]" for vectors and "A[i][j]" for matrices, where i, j start at 0.
Reimplemented from Inspectable.
| Inspectable::iparamvallist getInternalParams | ( | ) | const [virtual] |
Reimplemented from Inspectable.
| bool initIntern | ( | ) | [protected, virtual] |
to be overloaded by subclasses The rsensornumber and rmotornumber are already stored in the member variables.
The random values are to be accessed via the noiseGenerator.
Implements AbstractWiring.
| void setFeedbackRatio | ( | const matrix::Matrix & | ratios | ) | [virtual] |
sets the feedback ratio vector.
The size of the vector must be at least as large as getFeedbackRatio()
double defaultfeedbackratio [protected] |
matrix::Matrix feedbackratio [protected] |
int vmotornumber [protected] |
1.6.3