Robotsystem from Robot Group Leipzig: Agent Class Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Alphabetical List
- Class Hierarchy
- Class Members

# Agent Class Reference

`#include <agent.h>`

Inheritance diagram for Agent:

[legend]
Collaboration diagram for Agent:

[legend]
List of all members.

## Detailed Description

Object containing controller, robot and wiring between them.

(Corresponding to use of the word in the robotic/simulation domain.)

Definition at line 127 of file agent.h.

## Public Member Functions
| Agent (const PlotOption &plotOption)
| constructor
| Agent (const list< PlotOption > &plotOptions)
virtual | ~Agent ()
| destructor
virtual bool | init (AbstractController *controller, AbstractRobot *robot, AbstractWiring *wiring)
| initializes the object with the given controller, robot and wiring and initializes pipe to guilogger
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
## 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

## Constructor & Destructor Documentation

Agent | ( | const PlotOption & | plotOption | ) |

| constructor Definition at line 98 of file agent.cpp.

Agent | ( | const list< PlotOption > & | plotOptions | ) |

| Definition at line 104 of file agent.cpp.

~Agent | ( |  | ) | `[virtual]`

| destructor Definition at line 120 of file agent.cpp.

## Member Function Documentation

virtual AbstractController* getController | ( |  | ) | `[inline, virtual]`

| Returns a pointer to the controller. Definition at line 153 of file agent.h.

virtual AbstractRobot* getRobot | ( |  | ) | `[inline, virtual]`

| Returns a pointer to the robot. Reimplemented in OdeAgent. Definition at line 157 of file agent.h.

virtual AbstractWiring* getWiring | ( |  | ) | `[inline, virtual]`

| Returns a pointer to the wiring. Definition at line 161 of file agent.h.

bool init | ( | AbstractController * | controller,
|  | AbstractRobot * | robot,
|  | AbstractWiring * | wiring
| ) | `[virtual]`

| initializes the object with the given controller, robot and wiring and initializes pipe to guilogger Definition at line 134 of file agent.cpp.

void internInit | ( |  | ) | `[protected]`

| Reimplemented in OdeAgent. Definition at line 109 of file agent.cpp.

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. Parameters:
  | rx | actual sensorvalues from robot (used for generation of motorcommand in actual timestep)
  | cx | actual sensorvalues which are passed to controller (used for generation of motorcommand in actual timestep)
  | y | actual motorcommand (generated in the actual timestep)
Definition at line 201 of file agent.cpp.

void setTrackOptions | ( | const TrackRobot & | trackrobot | ) | `[virtual]`

| sets the trackoptions which enable tracking of a robot Definition at line 252 of file agent.cpp.

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. Parameters:
  | noise | Noise strength.
Reimplemented in OdeAgent. Definition at line 224 of file agent.cpp.

## Member Data Documentation

int cmotornumber`[protected]`

| number of motors of comntroller Definition at line 189 of file agent.h.

motor* cmotors`[protected]`

| Definition at line 194 of file agent.h.

AbstractController* controller`[protected]`

| Definition at line 178 of file agent.h.

int csensornumber`[protected]`

| number of sensors of comntroller Definition at line 187 of file agent.h.

sensor* csensors`[protected]`

| Definition at line 193 of file agent.h.

int rmotornumber`[protected]`

| number of motors of robot Definition at line 185 of file agent.h.

motor* rmotors`[protected]`

| Definition at line 192 of file agent.h.

AbstractRobot* robot`[protected]`

| Definition at line 179 of file agent.h.

int rsensornumber`[protected]`

| number of sensors of robot Definition at line 183 of file agent.h.

sensor* rsensors`[protected]`

| Definition at line 191 of file agent.h.

TrackRobot trackrobot`[protected]`

| Definition at line 199 of file agent.h.

AbstractWiring* wiring`[protected]`

| Definition at line 180 of file agent.h.