WiredController Class Reference

The WiredController contains a controller and a wiring, which connects the controller with the robot. More...

#include <wiredcontroller.h>

Inherits Inspectable, and BackCaller.

Inherited by Agent.

Inheritance diagram for WiredController:

Inheritance graph
[legend]
Collaboration diagram for WiredController:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 WiredController (const PlotOption &plotOption=PlotOption(NoPlot), double noisefactor=1)
 constructor.
 WiredController (const std::list< PlotOption > &plotOptions, double noisefactor=1)
 constructor.
virtual ~WiredController ()
 destructor
bool init (AbstractController *controller, AbstractWiring *wiring, int robotsensornumber, int robotmotornumber, RandGen *randGen=0)
 initializes the object with the given controller and wiring and initializes the output options It is also possible to provide a random seed, if not given (0) rand() is used to create one
void step (const sensor *sensors, int sensornumber, motor *motors, int motornumber, double noise, double time=-1)
 Performs an step of the controller, which includes pushing sensor values through the wiring, controller step, pushing controller outputs (= motorcommands) back through the wiring.
virtual PlotOption addPlotOption (PlotOption &plotoption)
 adds the PlotOptions to the list of plotoptions If a plotoption with the same Mode exists, then the old one is deleted first
bool addAndInitPlotOption (PlotOption &plotOption)
 adds a new PlotOption and initializes it
virtual bool removePlotOption (PlotMode mode)
 removes the PlotOptions with the given type
virtual void addInspectable (const Inspectable *inspectable)
 adds an inspectable object for logging.
virtual void addConfigurable (const Configurable *c)
 adds an configureable object for logging.
virtual void writePlotComment (const char *cmt)
 write comment to output streams (PlotOptions).
virtual AbstractControllergetController ()
 Returns a pointer to the controller.
virtual AbstractWiringgetWiring ()
 Returns a pointer to the wiring.

Protected Member Functions

virtual void plot (double time)
 Plots controller sensor- and motorvalues and internal controller parameters.
void internInit ()

Protected Attributes

AbstractControllercontroller
AbstractWiringwiring
int rsensornumber
 number of sensors of robot
int rmotornumber
 number of motors of robot
int csensornumber
 number of sensors of comntroller
int cmotornumber
 number of motors of comntroller
double noisefactor
 factor that is muliplied with noise stength
motorcmotors
sensorcsensors
PlotOptionEngine plotEngine
bool initialised
std::list< Callbackable * > callbackables
long int t

Detailed Description

The WiredController contains a controller and a wiring, which connects the controller with the robot.

Additionally there are some ways to keep track of internal information. You have the possibility to keep track of sensor values, motor values and internal parameters of the controller with PlotOptions. The name PlotOptions is a bit missleaded, it should be "OutputOptions", however you can write the data into a file or send it to visualisation tools like guilogger or neuronviz.


Constructor & Destructor Documentation

WiredController ( const PlotOption plotOption = PlotOption(NoPlot),
double  noisefactor = 1 
)

constructor.

PlotOption as output setting. noisefactor is used to set the relative noise strength of this agent

WiredController ( const std::list< PlotOption > &  plotOptions,
double  noisefactor = 1 
)

constructor.

A list of PlotOption can given. noisefactor is used to set the relative noise strength of this agent

~WiredController (  )  [virtual]

destructor


Member Function Documentation

bool addAndInitPlotOption ( PlotOption plotOption  ) 

adds a new PlotOption and initializes it

See also:
addPlotOption

void addConfigurable ( const Configurable c  )  [virtual]

adds an configureable object for logging.

Must be called before init!

void addInspectable ( const Inspectable inspectable  )  [virtual]

adds an inspectable object for logging.

Must be called before init!

PlotOption addPlotOption ( PlotOption plotoption  )  [virtual]

adds the PlotOptions to the list of plotoptions If a plotoption with the same Mode exists, then the old one is deleted first

virtual AbstractController* getController (  )  [inline, virtual]

Returns a pointer to the controller.

virtual AbstractWiring* getWiring (  )  [inline, virtual]

Returns a pointer to the wiring.

bool init ( AbstractController controller,
AbstractWiring wiring,
int  robotsensornumber,
int  robotmotornumber,
RandGen randGen = 0 
)

initializes the object with the given controller and wiring and initializes the output options It is also possible to provide a random seed, if not given (0) rand() is used to create one

void internInit (  )  [protected]

Reimplemented in OdeAgent.

void plot ( double  time  )  [protected, virtual]

Plots controller sensor- and motorvalues and internal controller parameters.

Parameters:
time simulation time

bool removePlotOption ( PlotMode  mode  )  [virtual]

removes the PlotOptions with the given type

Returns:
true if sucessful, false otherwise

void step ( const sensor sensors,
int  sensornumber,
motor motors,
int  motornumber,
double  noise,
double  time = -1 
)

Performs an step of the controller, which includes pushing sensor values through the wiring, controller step, pushing controller outputs (= motorcommands) back through the wiring.

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
noise Noise strength.
time (optional) current simulation time (used for logging)

void writePlotComment ( const char *  cmt  )  [virtual]

write comment to output streams (PlotOptions).

For instance changes in parameters.


Member Data Documentation

std::list<Callbackable* > callbackables [protected]

int cmotornumber [protected]

number of motors of comntroller

motor* cmotors [protected]

AbstractController* controller [protected]

int csensornumber [protected]

number of sensors of comntroller

sensor* csensors [protected]

bool initialised [protected]

double noisefactor [protected]

factor that is muliplied with noise stength

PlotOptionEngine plotEngine [protected]

int rmotornumber [protected]

number of motors of robot

int rsensornumber [protected]

number of sensors of robot

long int t [protected]

Reimplemented in Agent.

AbstractWiring* wiring [protected]


The documentation for this class was generated from the following files:
Generated on Fri Oct 30 16:29:03 2009 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.4.7