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

CStateProperties Class Reference

Class defining the Properties of a State. More...

#include <cstateproperties.h>

Inheritance diagram for CStateProperties:

CStateModifier CAbstractStateDiscretizer CFeatureCalculator CFeatureStateNNInput CLocal4GridWorldState CLocal4XGridWorldState CLocal8GridWorldState CNeuralNetworkStateModifier CStateVariablesChooser List of all members.


Public Member Functions

  CStateProperties (unsigned int continuousStates, unsigned int discreteStates, int type=0)
  Creates a properties object with continuousStates continuous states and discreteStates discrete states.

  CStateProperties (CStateProperties *properties)
  Creates a properties object with the same properties as the given properties object.

virtual  ~CStateProperties ()
int  getType ()
bool  isType (int type)
void  addType (int Type)
  adds a specific type to the type field bitmap

void  setDiscreteStateSize (unsigned int dim, unsigned int size)
  Sets the discrete state size of the dim th state.

virtual unsigned int  getDiscreteStateSize (unsigned int dim)
  Returns the discrete state size of the dim th state.

unsigned int  getNumContinuousStates ()
  Returns the number of continuous state variables.

unsigned int  getNumDiscreteStates ()
  Returns the number of discrete state variables.

virtual unsigned int  getDiscreteStateSize ()
  returns the discrete state size of all discrete states together (i.e the product of all sizes)

void  setMinValue (unsigned int dim, double value)
  sets the min-value of the dim-th continuous state

double  getMinValue (unsigned int dim)
  returns the min-value of the dim-th continuous state

void  setMaxValue (unsigned int dim, double value)
  sets the max-value of the dim-th continuous state

double  getMaxValue (unsigned int dim)
  returns the max-value of the dim-th continuous state

void  setPeriodicity (unsigned int index, bool isPeriodic)
bool  getPeriodicity (unsigned int index)
double  getMirroredStateValue (unsigned int index, double value)
bool  equals (CStateProperties *object)
  Compares two properties in all their attributes, even discrete state sizes min and max values.



Protected Member Functions

  CStateProperties ()
virtual void  initProperties (unsigned int continuousStates, unsigned int discreteStates, int type=0)


Protected Attributes

unsigned int  continuousStates
  number of continuous states

unsigned int  discreteStates
  number of discrete states

int  type
  type of the State

unsigned int *  discreteStateSize
  an array containing the discrete state sizes

double *  minValues
  an array containing the minimum values of the continuous states

double *  maxValues
  an array containing the maximum values of the continuous states

bool *  isPeriodic
bool  bInit

Detailed Description

Class defining the Properties of a State.

The class contains all the Properties a single State can have. Each CState (actually even each CStateObject) has a pointer to his state properties. The class contains the number of discrete and continuous states-variables, the discrete state size for each discrete state variable and the minimum and maximum values for the continuous states.

The member type describes the type of the state. There are three different types by now:

  • 0 : "Normal" Modelstate: Can have an arbitrary number of discrete and continuous states, can't be used for the most qFunctions.
  • DISCRETESTATE: Can only have one discrete state. These states are usually calculated by a CAbstractStateDiscretizer, not by the model.
  • FEATURESTATE: Has to have the same number of discrete and continuous states. The i th continuous state coresponds to the i th discrete state, the discrete states determine the feature index and the continuous states the factor of that feature. All discrete state sizes have to be the same, all factors have to sum up to one, their minimum value is 0.0 and their max value is 1.0.

The state properties object are also very important for the CStateCollection class. Here the state properties object pointer serves as Id to retrieve the state with the specific properties from the statecollection.

See also:
CStateObject

CState

CStateCollection


Constructor & Destructor Documentation

CStateProperties::CStateProperties  )  [protected]
 
CStateProperties::CStateProperties unsigned int  continuousStates,
unsigned int  discreteStates,
int  type = 0
 

Creates a properties object with continuousStates continuous states and discreteStates discrete states.

The discrete state sizes, minimum and maximum values cant't be given to the constructor, these values have to be set explicitly.

CStateProperties::CStateProperties CStateProperties properties  ) 
 

Creates a properties object with the same properties as the given properties object.

virtual CStateProperties::~CStateProperties  )  [virtual]
 

Member Function Documentation

void CStateProperties::addType int  Type  ) 
 

adds a specific type to the type field bitmap

So The parameter should be a power of 2, because al bits in the "Type" parameter gets set with an OR mask to the internal type.

bool CStateProperties::equals CStateProperties object  ) 
 

Compares two properties in all their attributes, even discrete state sizes min and max values.

virtual unsigned int CStateProperties::getDiscreteStateSize  )  [virtual]
 

returns the discrete state size of all discrete states together (i.e the product of all sizes)

Reimplemented in CAbstractStateDiscretizer, and CFeatureCalculator.

virtual unsigned int CStateProperties::getDiscreteStateSize unsigned int  dim  )  [virtual]
 

Returns the discrete state size of the dim th state.

Reimplemented in CFeatureCalculator.

double CStateProperties::getMaxValue unsigned int  dim  ) 
 

returns the max-value of the dim-th continuous state

double CStateProperties::getMinValue unsigned int  dim  ) 
 

returns the min-value of the dim-th continuous state

double CStateProperties::getMirroredStateValue unsigned int  index,
double  value
 
unsigned int CStateProperties::getNumContinuousStates  ) 
 

Returns the number of continuous state variables.

unsigned int CStateProperties::getNumDiscreteStates  ) 
 

Returns the number of discrete state variables.

bool CStateProperties::getPeriodicity unsigned int  index  ) 
 
int CStateProperties::getType  ) 
 
virtual void CStateProperties::initProperties unsigned int  continuousStates,
unsigned int  discreteStates,
int  type = 0
[protected, virtual]
 
bool CStateProperties::isType int  type  ) 
 
void CStateProperties::setDiscreteStateSize unsigned int  dim,
unsigned int  size
 

Sets the discrete state size of the dim th state.

void CStateProperties::setMaxValue unsigned int  dim,
double  value
 

sets the max-value of the dim-th continuous state

void CStateProperties::setMinValue unsigned int  dim,
double  value
 

sets the min-value of the dim-th continuous state

void CStateProperties::setPeriodicity unsigned int  index,
bool  isPeriodic
 

Member Data Documentation

bool CStateProperties::bInit [protected]
 
unsigned int CStateProperties::continuousStates [protected]
 

number of continuous states

unsigned int CStateProperties::discreteStates [protected]
 

number of discrete states

Reimplemented in CModelStateDiscretizer.

unsigned int* CStateProperties::discreteStateSize [protected]
 

an array containing the discrete state sizes

bool* CStateProperties::isPeriodic [protected]
 
double* CStateProperties::maxValues [protected]
 

an array containing the maximum values of the continuous states

double* CStateProperties::minValues [protected]
 

an array containing the minimum values of the continuous states

int CStateProperties::type [protected]
 

type of the State


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