Agent Class Reference

The Agent contains a controller, a robot and a wiring, which connects robot and controller. More...

#include <agent.h>

Inherits WiredController.

Inherited by OdeAgent.

Inheritance diagram for Agent:

Inheritance graph
[legend]
Collaboration diagram for Agent:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Agent (const PlotOption &plotOption=PlotOption(NoPlot), double noisefactor=1)
 constructor.
 Agent (const std::list< PlotOption > &plotOptions, double noisefactor=1)
 constructor.
virtual ~Agent ()
 destructor
virtual bool init (AbstractController *controller, AbstractRobot *robot, AbstractWiring *wiring, long int seed=0)
 initializes the object with the given controller, robot and wiring and initializes the output options.
virtual void step (double noise, double time=-1)
 Performs an step of the agent, including sensor reading, pushing sensor values through the wiring, controller step, pushing controller outputs (= motorcommands) back through the wiring and sent resulting motorcommands to robot.
virtual void onlyControlRobot ()
 Sends only last motor commands again to robot.
virtual AbstractRobotgetRobot ()
 Returns a pointer to the robot.
virtual void setTrackOptions (const TrackRobot &trackrobot)
 sets the trackoptions which enable tracking of a robot

Protected Attributes

AbstractRobotrobot
sensorrsensors
motorrmotors
RandGen randGen
TrackRobot trackrobot
int t

Detailed Description

The Agent contains a controller, a robot and a wiring, which connects robot and controller.

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(). Please be aware that the Agent inherits from WiredController. You might also find useful functions there.

Examples:

integration/main.cpp.


Constructor & Destructor Documentation

Agent ( 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

Agent ( 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

~Agent (  )  [virtual]

destructor


Member Function Documentation

virtual AbstractRobot* getRobot (  )  [inline, virtual]

Returns a pointer to the robot.

Reimplemented in OdeAgent.

bool init ( AbstractController controller,
AbstractRobot robot,
AbstractWiring wiring,
long int  seed = 0 
) [virtual]

initializes the object with the given controller, robot 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

Examples:
integration/main.cpp.

void onlyControlRobot (  )  [virtual]

Sends only last motor commands again to robot.

void setTrackOptions ( const TrackRobot trackrobot  )  [virtual]

sets the trackoptions which enable tracking of a robot

void step ( double  noise,
double  time = -1 
) [virtual]

Performs an step of the agent, including sensor reading, pushing sensor values through the wiring, controller step, pushing controller outputs (= motorcommands) back through the wiring and sent resulting motorcommands to robot.

Parameters:
noise Noise strength.
time (optional) current simulation time (used for logging)

Reimplemented in OdeAgent.

Examples:
integration/main.cpp.


Member Data Documentation

RandGen randGen [protected]

motor* rmotors [protected]

AbstractRobot* robot [protected]

sensor* rsensors [protected]

int t [protected]

Reimplemented from WiredController.

TrackRobot trackrobot [protected]


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