#include <agent.h>
Inherited by OdeAgent.
Inheritance diagram for Agent:


Public Member Functions | |
| Agent (const PlotOption &plotOption) | |
| constructor. | |
| Agent (const std::list< PlotOption > &plotOptions) | |
| constructor. | |
| virtual | ~Agent () |
| destructor | |
| virtual bool | init (AbstractController *controller, AbstractRobot *robot, AbstractWiring *wiring) |
| initializes the object with the given controller, robot and wiring and initializes the output options | |
| virtual void | step (double noise) |
| Performs an step of the agent, including sensor reading, pushing sensor values through wiring, controller step, pushing controller outputs (= motorcommands) back through wiring and sent resulting motorcommands to robot. | |
| virtual AbstractController * | getController () |
| Returns a pointer to the controller. | |
| virtual AbstractRobot * | getRobot () |
| Returns a pointer to the robot. | |
| virtual AbstractWiring * | getWiring () |
| Returns a pointer to the wiring. | |
| virtual void | setTrackOptions (const TrackRobot &trackrobot) |
| sets the trackoptions which enable tracking of a robot | |
| virtual void | addPlotOption (const 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 | |
| virtual bool | removePlotOption (PlotMode mode) |
| removes the PlotOptions with the given type | |
Protected Member Functions | |
| virtual void | plot (const sensor *rx, int rsensornumber, const sensor *cx, int csensornumber, const motor *y, int motornumber) |
| Plots controller sensor- and motorvalues and internal controller parameters. | |
| void | internInit () |
Protected Attributes | |
| AbstractController * | controller |
| AbstractRobot * | robot |
| AbstractWiring * | wiring |
| 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 | |
| sensor * | rsensors |
| motor * | rmotors |
| sensor * | csensors |
| motor * | cmotors |
| TrackRobot | trackrobot |
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 visialisation tools like guilogger or neuronviz.
If want to log the position, speed and orienation of your robot you can use setTrackOptions().
integration/main.cpp, and main.cpp.
| Agent | ( | const PlotOption & | plotOption | ) |
constructor.
PlotOption an output setting.
| Agent | ( | const std::list< PlotOption > & | plotOptions | ) |
constructor.
A list of PlotOption can begin. A PlotOption is an output setting.
| ~Agent | ( | ) | [virtual] |
destructor
| void addPlotOption | ( | const 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 AbstractRobot* getRobot | ( | ) | [inline, virtual] |
| virtual AbstractWiring* getWiring | ( | ) | [inline, virtual] |
Returns a pointer to the wiring.
| bool init | ( | AbstractController * | controller, | |
| AbstractRobot * | robot, | |||
| AbstractWiring * | wiring | |||
| ) | [virtual] |
initializes the object with the given controller, robot and wiring and initializes the output options
| void internInit | ( | ) | [protected] |
Reimplemented in OdeAgent.
| void plot | ( | const sensor * | rx, | |
| int | rsensornumber, | |||
| const sensor * | cx, | |||
| int | csensornumber, | |||
| const motor * | y, | |||
| int | motornumber | |||
| ) | [protected, virtual] |
Plots controller sensor- and motorvalues and internal controller parameters.
| rx | actual sensorvalues from robot (used for generation of motorcommand in actual timestep) | |
| rsensornumber | length of rx | |
| cx | actual sensorvalues which are passed to controller (used for generation of motorcommand in actual timestep) | |
| csensornumber | length of cx | |
| y | actual motorcommand (generated in the actual timestep) | |
| motornumber | length of y |
| bool removePlotOption | ( | PlotMode | mode | ) | [virtual] |
removes the PlotOptions with the given type
| void setTrackOptions | ( | const TrackRobot & | trackrobot | ) | [virtual] |
sets the trackoptions which enable tracking of a robot
| void step | ( | double | noise | ) | [virtual] |
Performs an step of the agent, including sensor reading, pushing sensor values through wiring, controller step, pushing controller outputs (= motorcommands) back through wiring and sent resulting motorcommands to robot.
| noise | Noise strength. |
Reimplemented in OdeAgent.
int cmotornumber [protected] |
number of motors of comntroller
AbstractController* controller [protected] |
int csensornumber [protected] |
number of sensors of comntroller
int rmotornumber [protected] |
number of motors of robot
AbstractRobot* robot [protected] |
int rsensornumber [protected] |
number of sensors of robot
TrackRobot trackrobot [protected] |
AbstractWiring* wiring [protected] |
1.4.7