OneControllerPerChannel Class Reference

class for using multiple controller, one for each joint. More...

#include <onecontrollerperchannel.h>

Inherits AbstractController.

Collaboration diagram for OneControllerPerChannel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 OneControllerPerChannel (ControllerGenerator *controllerGenerator, std::string controllerName, int numCtrlCreateBeforeInit=1, int numContextSensors=0)
virtual ~OneControllerPerChannel ()
virtual void init (int sensornumber, int motornumber, RandGen *randGen=0)
 initialisation of the controller with the given sensor/ motornumber Must 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 int getSensorNumber () const
virtual int getMotorNumber () const
virtual bool store (FILE *f) const
 stores the object to the given file stream (binary).
virtual bool restore (FILE *f)
 loads the object from the given file stream (binary).
virtual std::vector
< AbstractController * > 
getControllers () const

Protected Attributes

std::vector< AbstractController * > ctrl
ControllerGeneratorcontrollerGenerator
int numCtrlCreateBeforeInit
int numContextSensors
int motornumber
int sensornumber
double * sensorbuffer

Detailed Description

class for using multiple controller, one for each joint.

Each controller has dimension 1x1. The controller are generated on the fly with a generator object


Constructor & Destructor Documentation

OneControllerPerChannel ( ControllerGenerator controllerGenerator,
std::string  controllerName,
int  numCtrlCreateBeforeInit = 1,
int  numContextSensors = 0 
)
Parameters:
controllerGenerator generator object for controller
controllerName name
numCtrlCreateBeforeInit number of controller that are generated before the init function is called. Useful if they should be put into the inspectable list of the agent
numContextSensors number of context sensors (counted from the end) passed to all controllers
~OneControllerPerChannel (  )  [virtual]

Member Function Documentation

virtual std::vector<AbstractController*> getControllers (  )  const [inline, virtual]
virtual int getMotorNumber (  )  const [inline, virtual]
Returns:
Number of motors the controller was initialised with or 0 if not initialised

Implements AbstractController.

virtual int getSensorNumber (  )  const [inline, virtual]
Returns:
Number of sensors the controller was initialised with or 0 if not initialised

Implements AbstractController.

void init ( int  sensornumber,
int  motornumber,
RandGen randGen = 0 
) [virtual]

initialisation of the controller with the given sensor/ motornumber Must be called before use.

The random generator is optional.

Implements AbstractController.

bool restore ( FILE *  f  )  [virtual]

loads the object from the given file stream (binary).

Implements Storeable.

void step ( const sensor sensors,
int  sensornumber,
motor motors,
int  motornumber 
) [virtual]

performs one step (includes learning).

Calculates motor commands from sensor inputs.

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

Implements AbstractController.

void stepNoLearning ( const sensor ,
int  number_sensors,
motor ,
int  number_motors 
) [virtual]

performs one step without learning.

See also:
step

Implements AbstractController.

bool store ( FILE *  f  )  const [virtual]

stores the object to the given file stream (binary).

Implements Storeable.


Member Data Documentation

std::vector<AbstractController*> ctrl [protected]
int motornumber [protected]
int numContextSensors [protected]
int numCtrlCreateBeforeInit [protected]
double* sensorbuffer [protected]
int sensornumber [protected]

The documentation for this class was generated from the following files:
Generated on Thu Jun 28 14:48:15 2012 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.6.3