CAgent Class Reference
The
class represents the main acting Object of the Learning System, the
agent. More...
#include <cagent.h>
Inheritance diagram for CAgent:
List of all members.
Detailed Description
The class represents the main acting Object of the Learning System,
the agent.
The agent is the object which acts within its environment an
sends every step to its SemiMDPListener, its the only "acting"
object so it's the most important part of the toolbox. The Agent
follows the Policy set by setController(CAgentController
*). It saves the currentState, then tells the model which
action to execute and then saves the new state. Having done that
the agent is able to send the State-Action-State tuple to all its
Listeners.
- The agent's actionset can only maintain PrimitiveActions. The
agent has an agent controller which can choose from the actions in
the agent's actoinset. It is not allowed that an controller returns
an action which isn't in the agent's action set. ExtendedActions
can only be added to the CHierarchicalSemiMarkovDecisionProcess
class.
- Another important functionality of the agent are the
StateModifiers which can be added to the agent. The stateModifier
is than added to the stateCollections (currentState, lastState) of
the agent. If you add a StateModifier to the agent, the modified
state is calculated by the state modifier after the modelstate has
changed and added to the state collection. The modified State,
which can be a discrete, a feature or any other State calculated
from the original model state is now available to all Listeners,
and it only gets calculated once. So the Listeners have access to
several different kind of states.
- For the execution of actions you have several possibilities,
the agent can execute:
- a given action (doAction),
- a single action from the controller (doControllerStep)
- or one or more Episodes following the Policy from the
Controller (doControllerEpisode). You can specify how much steps
each episode should have at maximum. The agent also loggs the
current episode. You need the current Episode for the hierarchical
SMDPs, they need an instance of the Episode to reconstruct the
intermediate steps. This feature can be turned off by
setLoggegEpisode(bool) for performance reasons if it isn't
needed.
- See also:
- CSemiMDPListener
CHierarchicalSemiMarkovDecisionProcess
CSemiMarkovDecisionProcess
Constructor & Destructor Documentation
Member Function Documentation
| |
add an primitiv action to the agent's actionlist. The agent can
only choose from this actions.
|
| virtual void
CAgent::addStateModifier
|
( |
CStateModifier *
|
modifier |
) |
[virtual] |
|
| virtual void
CAgent::doAction
|
( |
CAction *
|
action |
) |
[virtual] |
|
| |
Execute the action and send the State-Action-State tuple.
Reimplemented in CHiearchicalAgent.
|
| int
CAgent::doControllerEpisode
|
( |
int |
maxEpisodes =
1,
|
|
|
int |
maxSteps =
5000 |
|
) |
|
|
| |
Executes maxEpisodes, if an epsiode reaches maxsteps, a new
episode is startet automatically Returns -1 if training has been
paused by a keystroke. Call doResume() to continue
training.
|
| void
CAgent::doControllerStep
|
( |
|
) |
|
|
| |
Gets action from the controller and executes it.
Be aware that you will get an assertation if the agent
controller isn't set probably!
|
| |
Resume the Training if it was paused (e.g. by a keystroke)
Returns -1 if training has been paused by a keystroke. Call
doResume() to continue
training.
|
| int CAgent::doRun |
( |
bool |
bContinue |
) |
[protected] |
|
| virtual CEpisode*
CAgent::getCurrentEpisode
|
( |
|
) |
[virtual] |
|
| |
Returns the currentEpisode Object (only valid if bLogEpisode =
true).
|
| bool
CAgent::getKeyboardBreak
|
( |
|
) |
|
|
| virtual void
CAgent::removeStateModifier
|
( |
CStateModifier *
|
modifier |
) |
[virtual] |
|
| void
CAgent::setKeyboardBreak
|
( |
bool |
keyboardBreak |
) |
|
|
| |
Sets wether the training can be paused by a
keystroke.
|
| virtual void
CAgent::setLogEpisode
|
( |
bool |
bLogEpisode |
) |
[virtual] |
|
| |
Sets wether the currentEpisode should be logged or
not.
|
| void
CAgent::setParameters
|
( |
int |
maxEpisodes,
|
|
|
int |
maxSteps |
|
) |
|
|
| |
Set the Training Parameters, called by
doControllerEpisode.
|
| virtual void
CAgent::startNewEpisode
|
( |
|
) |
[virtual] |
|
Member Data Documentation
The documentation for this class was generated from the following
file:
|