FeedbackWiring Class Reference

Implements essentionally a one to one wiring with feedback connections. More...

#include <feedbackwiring.h>

Inherits AbstractWiring.

Inheritance diagram for FeedbackWiring:

Inheritance graph
[legend]
Collaboration diagram for FeedbackWiring:

Collaboration graph
[legend]
List of all members.

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 bool init (int robotsensornumber, int robotmotornumber, RandGen *randGen=0)
 Initializes the number of sensors and motors from robot (to be precise the internal parameters rsensornumber and rmotornumber!), calculates the number of sensors and motors on controller side.
virtual bool wireSensors (const sensor *rsensors, int rsensornumber, sensor *csensors, int csensornumber, double noise)
 Realizes wiring from robot sensors to controller sensors.
virtual bool wireMotors (motor *rmotors, int rmotornumber, const motor *cmotors, int cmotornumber)
 Realizes wiring from controller motor outputs to robot motors.
virtual std::list< iparamkeygetInternalParamNames () const
 Returns the list of the names of all internal parameters.
virtual std::list< iparamvalgetInternalParams () const
 Returns a list of the values of all internal parameters (in the order given by getInternalParamNames()).
virtual matrix::Matrix getFeedbackRatio () const
 return the feedback ratio vector
virtual void setFeedbackRatio (const matrix::Matrix &)
 sets the feedback ratio vector.

Protected Attributes

Mode mode
double defaultfeedbackratio
matrix::Matrix feedbackratio
motormotors
 array that stored the values of the motors
int vmotornumber
sensornoisevals
 for storing the noise values
bool initialised

Detailed Description

Implements essentionally a one to one wiring with feedback connections.

The feedback connections from output to input is parameterised with a feedback strength. It is possible to generate virtual motors for context sensors.

In order to change the feedback strength use the following code after initialisation of the agent/wiredcontroller

    matrix::Matrix rs = wiring->getFeedbackRatio();
    double c=ratio;
    rs.toMapP(&c,constant);
    wiring->setFeedbackRatio(rs);


Member Enumeration Documentation

enum Mode

Enumerator:
Motor 
Context 
All 


Constructor & Destructor Documentation

FeedbackWiring ( NoiseGenerator noise,
Mode  mode = Context,
double  feedbackratio = 0.9 
)

constructor

Parameters:
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

\[ x_t = 0.1*x_t + 0.9*y_{t-1} \]

~FeedbackWiring (  )  [virtual]


Member Function Documentation

matrix::Matrix getFeedbackRatio (  )  const [virtual]

return the feedback ratio vector

Inspectable::iparamkeylist getInternalParamNames (  )  const [virtual]

Returns the list of the names of all internal parameters.

Reimplemented from AbstractWiring.

Inspectable::iparamvallist getInternalParams (  )  const [virtual]

Returns a list of the values of all internal parameters (in the order given by getInternalParamNames()).

Reimplemented from AbstractWiring.

bool init ( int  robotsensornumber,
int  robotmotornumber,
RandGen randGen = 0 
) [virtual]

Initializes the number of sensors and motors from robot (to be precise the internal parameters rsensornumber and rmotornumber!), calculates the number of sensors and motors on controller side.

Must be overloaded to calculate and provide the appropriate numbers controllersensornumber (csensornumber), controllermotornumber (cmotornumber), robotsensornumber (rsensornumber) and robotmotornumber (rmotornumber),

Parameters:
randGen pointer to random generator, if not given then a new one is created
Returns:
returns false on error, otherwise true

Implements AbstractWiring.

void setFeedbackRatio ( const matrix::Matrix  )  [virtual]

sets the feedback ratio vector.

The size of the vector must be at least as large as feedbackratio

bool wireMotors ( motor rmotors,
int  rmotornumber,
const motor cmotors,
int  cmotornumber 
) [virtual]

Realizes wiring from controller motor outputs to robot motors.

Must be overloaded in order to implement the appropriate mapping.

Parameters:
rmotors pointer to array of motorvalues for robot
rmotornumber number of robot motors
cmotors pointer to array of motorvalues from controller
cmotornumber number of motorvalues from controller
Returns:
returns false if error, else true

Implements AbstractWiring.

bool wireSensors ( const sensor rsensors,
int  rsensornumber,
sensor csensors,
int  csensornumber,
double  noise 
) [virtual]

Realizes wiring from robot sensors to controller sensors.

Must be overloaded in order to implement the appropriate mapping.

Parameters:
rsensors pointer to array of sensorvalues from robot
rsensornumber number of sensors from robot
csensors pointer to array of sensorvalues for controller
csensornumber number of sensors to controller
noise size of the noise added to the sensors
Returns:
returns false on error, otherwise true

Implements AbstractWiring.


Member Data Documentation

double defaultfeedbackratio [protected]

matrix::Matrix feedbackratio [protected]

bool initialised [protected]

Mode mode [protected]

motor* motors [protected]

array that stored the values of the motors

sensor* noisevals [protected]

for storing the noise values

int vmotornumber [protected]


The documentation for this class was generated from the following files:
Generated on Tue Sep 16 22:01:23 2008 for Robotsystem of the Robot Group Leipzig by  doxygen 1.4.7