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

CStateCollectionImpl Class Reference

Implementation of the CStateCollection interface. More...

#include <cstatecollection.h>

Inheritance diagram for CStateCollectionImpl:

CStateModifiersObject CStateCollection CStateObject List of all members.


Public Member Functions

  CStateCollectionImpl (CStateProperties *modelProperties)
  create state collection with the given state properties as basic state

  CStateCollectionImpl (CStateCollectionImpl *stateCollection)
  copy state collection

  CStateCollectionImpl (CStateProperties *properties, std::list< CStateModifier * > *modifiers)
  create state collection with the given state properties as basic state and the given modifiers already added.

virtual  ~CStateCollectionImpl ()
void  calculateModifiedStates ()
  calculate all modified states which are depricated

void  setState (CState *state)
  set the state in the state collection with the same properties like the given state

void  setStateCollection (CStateCollection *stateCollection)
virtual CState getState (CStateProperties *properties)
  get state with the given properties

virtual CState getState ()
  get basic state

virtual void  addStateModifier (CStateModifier *modifier)
  add state modifier

virtual void  removeStateModifier (CStateModifier *modfier)
  remove state modifier

virtual bool  isStateCalculated (CStateModifier *)
  returns wether the state has already been calculated

virtual void  setIsStateCalculated (CStateModifier *modifier, bool isCalculated)
  returns wether the state has already been calculated

virtual bool  isMember (CStateProperties *stateModifier)
  returns wether the modifier states or the basic state have the specified properties

void  newModelState ()
  marks all modified states as depricated, forces them to recalculate

virtual void  setResetState (bool reset)


Protected Attributes

CState modelState
  basic model state of the collection

std::map< CStateModifier *,

CState * > * 
modifiedStates
  stores all state modifiers with their states

std::map< CStateModifier *,

bool > * 
stateCalculated
  depricated flags


Detailed Description

Implementation of the CStateCollection interface.

A state collection contains the "basic" state, usually the model state, and a list of modified states with their state modifiers. Any component which has access to a statecollection (usually a listener), can retrieve a state from the state collection as long as he mantains the pointer to the properties of the desired state, which serves as the id of the state in the state collection. When you add a state modifier, a state with the properties of the modifier is created ans stored in a map (modifiedStates). Each time you change the model state you have to call the function newModelState(), the collection sets then all modified states as depricated. The modified state gets recalculated when it is requested for the first time and the deprecated flag of the state gets cleared.

You can also set the modified states directly without calculation, this is useful if the modified state is already available by a logger.


Constructor & Destructor Documentation

CStateCollectionImpl::CStateCollectionImpl CStateProperties modelProperties  ) 
 

create state collection with the given state properties as basic state

CStateCollectionImpl::CStateCollectionImpl CStateCollectionImpl stateCollection  ) 
 

copy state collection

CStateCollectionImpl::CStateCollectionImpl CStateProperties properties,
std::list< CStateModifier * > *  modifiers
 

create state collection with the given state properties as basic state and the given modifiers already added.

virtual CStateCollectionImpl::~CStateCollectionImpl  )  [virtual]
 

Member Function Documentation

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

add state modifier

Reimplemented from CStateModifiersObject.

void CStateCollectionImpl::calculateModifiedStates  ) 
 

calculate all modified states which are depricated

virtual CState* CStateCollectionImpl::getState  )  [virtual]
 

get basic state

Implements CStateCollection.

virtual CState* CStateCollectionImpl::getState CStateProperties properties  )  [virtual]
 

get state with the given properties

Implements CStateCollection.

virtual bool CStateCollectionImpl::isMember CStateProperties stateModifier  )  [virtual]
 

returns wether the modifier states or the basic state have the specified properties

Implements CStateCollection.

virtual bool CStateCollectionImpl::isStateCalculated CStateModifier  )  [virtual]
 

returns wether the state has already been calculated

void CStateCollectionImpl::newModelState  ) 
 

marks all modified states as depricated, forces them to recalculate

virtual void CStateCollectionImpl::removeStateModifier CStateModifier modfier  )  [virtual]
 

remove state modifier

Reimplemented from CStateModifiersObject.

virtual void CStateCollectionImpl::setIsStateCalculated CStateModifier modifier,
bool  isCalculated
[virtual]
 

returns wether the state has already been calculated

virtual void CStateCollectionImpl::setResetState bool  reset  )  [virtual]
 

Reimplemented from CStateCollection.

void CStateCollectionImpl::setState CState state  ) 
 

set the state in the state collection with the same properties like the given state

void CStateCollectionImpl::setStateCollection CStateCollection stateCollection  ) 
 

Member Data Documentation

CState* CStateCollectionImpl::modelState [protected]
 

basic model state of the collection

std::map<CStateModifier *, CState *>* CStateCollectionImpl::modifiedStates [protected]
 

stores all state modifiers with their states

std::map<CStateModifier *, bool>* CStateCollectionImpl::stateCalculated [protected]
 

depricated flags


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