24 #ifndef __SWITCHCONTROLLER_H
25 #define __SWITCHCONTROLLER_H
40 virtual void init(
int sensornumber,
int motornumber,
RandGen* randGen = 0);
41 virtual void step(
const sensor* sensors,
int sensornumber,
42 motor* motors,
int motornumber);
44 motor* motors,
int motornumber);
46 virtual int getSensorNumber()
const {
return controllers.front()->getSensorNumber();};
48 virtual int getMotorNumber()
const {
return controllers.front()->getMotorNumber();};
51 virtual bool store(FILE* f)
const {
return controllers.front()->store(f);};
52 virtual bool restore(FILE* f) {
return controllers.front()->restore(f);};
SwitchController(const std::list< AbstractController * > &controllers, const std::string &name="SwitchController", const std::string &revision="1.0")
Definition: switchcontroller.cpp:29
Abstract class for robot controller (with some basic functionality).
Definition: abstractcontroller.h:46
virtual bool store(FILE *f) const
stores the object to the given file stream (ASCII preferred).
Definition: switchcontroller.h:51
virtual ~SwitchController()
Definition: switchcontroller.cpp:41
std::list< AbstractController * > controllers
Definition: switchcontroller.h:56
iparamkey name
Definition: inspectable.h:251
random generator with 48bit integer arithmentic
Definition: randomgenerator.h:34
virtual void init(int sensornumber, int motornumber, RandGen *randGen=0)
initialisation of the controller with the given sensor/ motornumber Must be called before use...
Definition: switchcontroller.cpp:43
virtual int getMotorNumber() const
Definition: switchcontroller.h:48
virtual int getSensorNumber() const
Definition: switchcontroller.h:46
double sensor
Definition: abstractcontroller.h:48
meta controller for switching control between different subcontrollers.
Definition: switchcontroller.h:33
virtual bool restore(FILE *f)
loads the object from the given file stream (ASCII preferred).
Definition: switchcontroller.h:52
virtual void step(const sensor *sensors, int sensornumber, motor *motors, int motornumber)
performs one step (includes learning).
Definition: switchcontroller.cpp:50
double motor
Definition: abstractcontroller.h:49
virtual void stepNoLearning(const sensor *sensors, int sensornumber, motor *motors, int motornumber)
performs one step without learning.
Definition: switchcontroller.cpp:65
int activecontroller
Definition: switchcontroller.h:52