This is a passive controller adapter who is passive and can handle AbstractMeasures. More...
#include <measureadapter.h>
Inherits AbstractControllerAdapter.
Public Member Functions | |
MeasureAdapter (AbstractController *controller, const std::string &name="MeasureAdapter", const std::string &revision="$ID$") | |
Constructs the MeasureAdapter. | |
virtual | ~MeasureAdapter () |
virtual std::list < ComplexMeasure * > | addSensorComplexMeasure (char *measureName, ComplexMeasureMode mode, int numberBins, int stepSize) |
Adds a ComplexMeasure for measuring sensor values. | |
virtual void | init (int sensornumber, int motornumber, RandGen *randGen=0) |
initialisation of the controller with the given sensor/ motornumber Must NORMALLY be called before use. | |
virtual void | step (const sensor *sensors, int sensornumber, motor *motors, int motornumber) |
performs one step (includes learning). | |
virtual void | stepNoLearning (const sensor *sensors, int sensornumber, motor *motors, int motornumber) |
performs one step without learning. | |
virtual StatisticTools * | getStatisticTools () |
Protected Attributes | |
StatisticTools * | st |
bool | initialized |
motor * | motorValues |
sensor * | sensorValues |
This is a passive controller adapter who is passive and can handle AbstractMeasures.
Normally the sensor and/or motor values are measured.
MeasureAdapter | ( | AbstractController * | controller, | |
const std::string & | name = "MeasureAdapter" , |
|||
const std::string & | revision = "$ID$" | |||
) |
Constructs the MeasureAdapter.
~MeasureAdapter | ( | ) | [virtual] |
std::list< ComplexMeasure * > addSensorComplexMeasure | ( | char * | measureName, | |
ComplexMeasureMode | mode, | |||
int | numberBins, | |||
int | stepSize | |||
) | [virtual] |
Adds a ComplexMeasure for measuring sensor values.
For each sensor a ComplexMeasure is created.
virtual StatisticTools* getStatisticTools | ( | ) | [inline, virtual] |
void init | ( | int | sensornumber, | |
int | motornumber, | |||
RandGen * | randGen = 0 | |||
) | [virtual] |
initialisation of the controller with the given sensor/ motornumber Must NORMALLY be called before use.
For all ControllerAdapters call first AbstractControllerAdapter::init(sensornumber,motornumber) if you overwrite this method
Reimplemented from AbstractControllerAdapter.
performs one step (includes learning).
Calculates motor commands from sensor inputs.
sensors | sensors inputs scaled to [-1,1] | |
sensornumber | length of the sensor array | |
motors | motors outputs. MUST have enough space for motor values! | |
motornumber | length of the provided motor array |
Reimplemented from AbstractControllerAdapter.
bool initialized [protected] |
motor* motorValues [protected] |
sensor* sensorValues [protected] |
StatisticTools* st [protected] |