Reinforcement Learning Toolbox 2.0
last updated:
General
Documentation
Manual
Tutorial
Class Reference
Master Thesis
Examples
Related Papers
Downloads
Links
News
mailto:webmaster
Main Page     Class Hierarchy   Compound List   File List   Compound Members   File Members

CEpisode Class Reference

Class for logging a single Episode. More...

#include <cepisode.h>

Inheritance diagram for CEpisode:

CSemiMDPListener CStepHistory CParameterObject CStateModifiersObject CLearnDataObject CActionObject CParameters CStateObject CParameterObject CParameters 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

CEpisode::CEpisode CStateProperties properties,
CActionSet actions,
bool  autoNewEpisode = true
 

Creates an CEpisode object, the base state of the collection list has the properties "properties".

CEpisode::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".

initializes the collection list with the modifiers

virtual CEpisode::~CEpisode  )  [virtual]
 

Member Function Documentation

virtual void CEpisode::addStateModifier CStateModifier modifier  )  [virtual]
 

add state modifier to the episodes state collection list

Reimplemented from CStateModifiersObject.

CAction* CEpisode::getAction unsigned int  num,
CActionDataSet dataSet = NULL
 

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 from the Episode, just calls the equivalent function of the CStateCollectionList object

void CEpisode::getStateCollection int  index,
CStateCollectionImpl stateCollection
 

get a state collection from the Episode, just calls the equivalent function of the CStateCollectionList object

CStateList* CEpisode::getStateList CStateProperties properties  ) 
 
virtual void CEpisode::getStep int  num,
CStep step
[virtual]
 

returns the num th step.

Implements CStepHistory.

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.

virtual void CEpisode::nextStep CStateCollection oldState,
CAction action,
CStateCollection newState
[virtual]
 

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]
 

remove state modifier to the episodes state collection list

Reimplemented from CStateModifiersObject.

virtual void CEpisode::resetData  )  [virtual]
 

Implements CLearnDataObject.

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

CActionList* CEpisode::actionList [protected]
 

action list for the numSteps actions

bool CEpisode::autoNewEpisode [protected]
 

clear Episode when a newEpisode event occurs, default = true

CStateCollectionList* CEpisode::stateCollectionList [protected]
 

state collection list for the numSteps + 1 states


The documentation for this class was generated from the following file: