#include <feedbackwiring.h>
Inherits AbstractWiring.
Inheritance diagram for FeedbackWiring:


Public Types | |
| Motor = 1 | |
| Context = 2 | |
| All = 3 | |
| enum | Mode { Motor = 1, Context = 2, All = 3 } |
Public Member Functions | |
| FeedbackWiring (NoiseGenerator *noise, Mode mode=Context, double feedbackratio=0.9) | |
| 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 (int robotsensornumber, int robotmotornumber, RandGen *randGen=0) |
| to be overloaded by subclasses | |
| 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 |
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 | |||
| ) |
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] |
| bool initIntern | ( | int | robotsensornumber, | |
| int | robotmotornumber, | |||
| RandGen * | randGen = 0 | |||
| ) | [protected, virtual] |
| void setFeedbackRatio | ( | const matrix::Matrix & | ) | [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.4.7