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

CAbstractStateDiscretizer Class Reference

Interface for all state discretizer. More...

#include <cdiscretizer.h>

Inheritance diagram for CAbstractStateDiscretizer:

CStateModifier CStateProperties CDiscreteStateOperatorAnd CGlobalGridWorldDiscreteState CLocalGridWorldDiscreteState CModelStateDiscretizer CMultiPoleDiscreteState CMultiPoleFailedState CRaceTrackDiscreteState CSingleStateDiscretizer CSmallLocalGridWorldDiscreteState CTaxiIsTargetDiscreteState List of all members.


Public Member Functions

  CAbstractStateDiscretizer (unsigned int numStates)
  creates a state discretizer which with numState different states.

virtual  ~CAbstractStateDiscretizer ()
virtual unsigned int  getDiscreteStateSize ()
  Returns the discrete State size of discretizer, this is the discrete state of the 1st state variable.

virtual unsigned int  getDiscreteStateNumber (CStateCollection *state)=0
  Function used to determine the State index from a state collection (usually from the model state).

virtual void  getModifiedState (CStateCollection *originalState, CState *modifiedState)
  Registers the discrete state number into the modified state object.

virtual void  addStateSubstitution (int discState, CStateModifier *modifier)
  Adds a state substitution for a discrete state index.

virtual void  removeStateSubstitution (int discState)
  Removes the state substitution for the specified state.



Protected Attributes

std::map< int, std::pair<

CStateModifier *, CState * > * > * 
stateSubstitutions
  list of state substitutions


Detailed Description

Interface for all state discretizer.

Normal state discretization is done by all subclasses of CAbstractStateDiscretizer. CAbstractStateDiscretizer is a subclass of CStateModifier. Normal state discretization assigns a single discrete state index to the current model state. This number is calculated by the function int getDiscreteStateNumber(CStateCollection *), which has to be implemented by all subclasses. This function is called by the getModifiedState method and registered in the target state.

CAbstractStateDiscretizer also offers you the possibility to make state substitutions, which is done by addStateSubstitution. With state substitutions you can replace a special discrete state number with another state from a specified modifier. This is needed if you want a more precise resolution of the model state only for some specific discrete state numbers. It is also possible to add a feature state as state substitution. The state discretizer produces then feature states instead of discrete states.


Constructor & Destructor Documentation

CAbstractStateDiscretizer::CAbstractStateDiscretizer unsigned int  numStates  ) 
 

creates a state discretizer which with numState different states.

virtual CAbstractStateDiscretizer::~CAbstractStateDiscretizer  )  [virtual]
 

Member Function Documentation

virtual void CAbstractStateDiscretizer::addStateSubstitution int  discState,
CStateModifier modifier
[virtual]
 

Adds a state substitution for a discrete state index.

virtual unsigned int CAbstractStateDiscretizer::getDiscreteStateNumber CStateCollection state  )  [pure virtual]
 

Function used to determine the State index from a state collection (usually from the model state).

Implemented in CModelStateDiscretizer, CSingleStateDiscretizer, CDiscreteStateOperatorAnd, CGlobalGridWorldDiscreteState, CLocalGridWorldDiscreteState, CSmallLocalGridWorldDiscreteState, CRaceTrackDiscreteState, CMultiPoleDiscreteState, CMultiPoleFailedState, and CTaxiIsTargetDiscreteState.

virtual unsigned int CAbstractStateDiscretizer::getDiscreteStateSize  )  [virtual]
 

Returns the discrete State size of discretizer, this is the discrete state of the 1st state variable.

Reimplemented from CStateProperties.

virtual void CAbstractStateDiscretizer::getModifiedState CStateCollection originalState,
CState modifiedState
[virtual]
 

Registers the discrete state number into the modified state object.

The state number is calculated by the interface function getDiscreteStateNumber. The getModifiedState method passes through all state substitutions until the calculated state number is reached, summing up all discrete state sizes of the modifiers from the substitutions. This sum is than added to the calculated discrete state number to make the state index unique again. Whenever a substitution has been assigned to the current state number, the state to substitute is calculated (or taken from the state collection). Then the state is stored in the target state, and the the calculated discrete state number + the sum of the state sizes is added to all discrete state variables of the state substitutions.

Implements CStateModifier.

virtual void CAbstractStateDiscretizer::removeStateSubstitution int  discState  )  [virtual]
 

Removes the state substitution for the specified state.


Member Data Documentation

std::map<int, std::pair<CStateModifier *, CState *>*>* CAbstractStateDiscretizer::stateSubstitutions [protected]
 

list of state substitutions


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