CEpisode Class Reference
Class for
logging a single Episode. More...
#include <cepisode.h>
Inheritance diagram for CEpisode:
List of all members.
|
Public Member Functions
|
|
|
CEpisode (CStateProperties
*properties,
CActionSet
*actions, bool
autoNewEpisode=true)
|
| |
Creates an CEpisode object, the base state
of the collection list has the properties "properties".
|
|
|
CEpisode (CStateProperties
*properties,
CActionSet
*actions,
std::list< CStateModifier * >
*modifiers, bool
autoNewEpisode=true)
|
| |
Creates an CEpisode object, the base state
of the collection list has the properties "properties".
|
|
virtual
|
~CEpisode ()
|
|
virtual void
|
nextStep (CStateCollection *oldState,
CAction *action,
CStateCollection
*newState)
|
|
virtual void
|
newEpisode ()
|
| |
if autoNewEpisode is true, the episode gets
cleared
|
|
CStateList
*
|
getStateList (CStateProperties
*properties)
|
|
void
|
getStateCollection (int index,
CStateCollectionImpl
*stateCollection)
|
| |
get a state collection from the Episode,
just calls the equivalent function of the CStateCollectionList
object
|
|
void
|
getState (int index, CState *state)
|
| |
get a state from the Episode, just calls the
equivalent function of the CStateCollectionList
object
|
|
virtual void
|
addStateModifier (CStateModifier
*modifier)
|
| |
add state modifier to the episodes state
collection list
|
|
virtual void
|
removeStateModifier (CStateModifier
*modifier)
|
| |
remove state modifier to the episodes state
collection list
|
|
CAction *
|
getAction (unsigned int num,
CActionDataSet
*dataSet=NULL)
|
| |
get a action from the Episode, just calls
the equivalent function of the CActionList object
|
|
void
|
saveBIN (FILE *stream)
|
| |
Save as a binary.
|
|
void
|
loadBIN (FILE *stream)
|
| |
Load from a binary.
|
|
virtual void
|
saveData (FILE *stream)
|
| |
Save as text.
|
|
virtual void
|
loadData (FILE *stream)
|
| |
Load from a text.
|
|
virtual int
|
getNumSteps ()
|
| |
returns the number of steps logged by the
episode.
|
|
virtual void
|
getStep (int num, CStep *step)
|
| |
returns the num th step.
|
|
virtual int
|
getNumStateCollections
()
|
|
virtual void
|
resetData ()
|
Protected Attributes
|
|
bool
|
autoNewEpisode |
| |
clear Episode when a newEpisode event
occurs, default = true
|
|
CStateCollectionList
*
|
stateCollectionList |
| |
state collection list for the numSteps + 1
states
|
|
CActionList
*
|
actionList |
| |
action list for the numSteps actions
|
Detailed Description
Class for logging a single Episode.
The episodes objects (CEpisode) can store only one episode. The
episode stores numSteps actions and numSteps + 1 states, therefore
it uses a CActionList and a CStateCollectionList
object. The episodes are also listeners, so you can add them to the
agent’s listeners list and they will log the current episode.
When a newEpisode event occurs the episode object is cleared. The
agent logger uses a list CEpisode objects to log the whole training
trial. There are always numSteps + 1 states and numSteps actions in
the lists (except numSteps = 0, then both lists are empty). The
episode stores only those states which's state modifier objects
(i.e. the properties) are in the state modifier list of the logger.
For retrieving state collections or action objects, the methods
from the CStateCollectionList and
CActionList objects
are used. The episode implements the interface CStepHistory, so you can retrieve
random steps for learning from any episode. This is an alternative
way of updating you Q or V Functions.
- See also:
- CEpisodeHistory
CAgentLogger
Constructor & Destructor Documentation
| |
Creates an CEpisode object, the base state of the collection
list has the properties "properties".
|
| |
Creates an CEpisode object, the base state of the collection
list has the properties "properties".
initializes the collection list with the
modifiers
|
| virtual
CEpisode::~CEpisode
|
( |
|
) |
[virtual] |
|
Member Function Documentation
| virtual void
CEpisode::addStateModifier
|
( |
CStateModifier *
|
modifier |
) |
[virtual] |
|
| |
get a action from the Episode, just calls the equivalent
function of the CActionList
object
|
| virtual int
CEpisode::getNumStateCollections
|
( |
|
) |
[virtual] |
|
| virtual int
CEpisode::getNumSteps
|
( |
|
) |
[virtual] |
|
| |
returns the number of steps logged by the episode.
Implements CStepHistory.
|
| void
CEpisode::getState
|
( |
int |
index,
|
|
|
CState *
|
state |
|
) |
|
|
| |
get a state collection from the Episode, just calls the
equivalent function of the CStateCollectionList
object
|
| virtual void
CEpisode::getStep
|
( |
int |
num,
|
|
|
CStep *
|
step |
|
) |
[virtual] |
|
| void
CEpisode::loadBIN
|
( |
FILE * |
stream |
) |
|
|
| |
Load from a binary.
Uses the load functions from the state collection list and the
action list object.
|
| virtual void
CEpisode::loadData
|
( |
FILE * |
stream |
) |
[virtual] |
|
| |
Load from a text.
Uses the load functions from the state collection list and the
action list object.
Implements CLearnDataObject.
|
| virtual void
CEpisode::newEpisode
|
( |
|
) |
[virtual] |
|
| |
if autoNewEpisode is true, the episode gets cleared
Reimplemented from CSemiMDPListener.
|
| |
Stores the newState and the action, if it was the first step,
the oldState object is also saved (before newState).
Reimplemented from CSemiMDPListener.
|
| virtual void
CEpisode::removeStateModifier
|
( |
CStateModifier *
|
modifier |
) |
[virtual] |
|
| virtual void
CEpisode::resetData
|
( |
|
) |
[virtual] |
|
| void
CEpisode::saveBIN
|
( |
FILE * |
stream |
) |
|
|
| |
Save as a binary.
Uses the save functions from the state collection list and the
action list object.
|
| virtual void
CEpisode::saveData
|
( |
FILE * |
stream |
) |
[virtual] |
|
| |
Save as text.
Uses the save functions from the state collection list and the
action list object.
Implements CLearnDataObject.
|
Member Data Documentation
| |
action list for the numSteps actions
|
| |
clear Episode when a newEpisode event occurs, default =
true
|
| |
state collection list for the numSteps + 1
states
|
The documentation for this class was generated from the following
file:
|