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

CAction Class Reference

Class Representing an action the agent or any other SMDP can choose from. More...

#include <caction.h>

Inheritance diagram for CAction:

CMultiStepAction CPrimitiveAction CExtendedAction CContinuousAction CGridWorldAction CMultiPoleAction CPickupAction CPutdownAction CStochasticModelAction CExtendedPrimitiveAction CHierarchicalSemiMarkovDecisionProcess CPrimitiveActionStateChange CStaticContinuousAction CSubGoalBehaviour CTaxiHierarchicalBehaviour CLinearFAContinuousAction CContinuousRBFAction List of all members.


Public Member Functions

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

virtual CActionData getNewActionData ()
  Returns an new CActionData object of the specific sub-class.

virtual void  loadActionData (CActionData *actionData)
  Set the changeable data according to the actiondata object.

virtual CActionData getActionData ()
  Returns an actiondata object initialised with the actions values.

virtual bool  isAvailable (CStateCollection *)
virtual int  getDuration ()
  returns the duration of the action, per default 1

virtual bool  equals (CAction *action)
  Determines wether the 2 actions represent the same action.

virtual bool  isSameAction (CAction *action, CActionData *data)
  Compares the action and the actionData obejcts.



Protected Member Functions

  CAction (CActionData *actionData)


Protected Attributes

int  type
CActionData actionData

Detailed Description

Class Representing an action the agent or any other SMDP can choose from.

The class represents an interface for all kind of actions. The interface consists of an action type, methods for handling the action data object of the action and the isAvailable Method. The action itself is identified with the pointer of the action abject together with an specific actionSet. So if you want to know the index of an action, you first must have an action set and then call its getIndex(CAction *) method. The class is just an interface for all other actions. It maintains type field to determine which type the action is. There are following types:

  • EXTENDEDACTION
  • MULTISTEPACTION
  • PRIMITIVEACTION
  • CONTINUOUSACTION
  • CONTINUOUSSTATICACTION

Each type belongs to a specific class. Don't add a type if the class isn't subclass of the class belonging to the type! This will lead to type cast errors. If the type is added the class has to be cast-able to the class representing the type.

All the direct subclasses of CAction have CAction as a virtual base class, so you can combine the attributes of the different actions. For example you can create an PrimitiveAction which can last for several steps (deviated from CPrimitiveAction and CMultiStepAction). Be carefull, due to the virtual base class you ALWAYS have to do a dynamic_cast instead of a normal type cast if you want to cast any CAction class object.
It also has the member isAvailable(CStateCollection *), which is per default always true. With this function you can exclude specific actions in some states, when they are not avialable for the agent. Befor choosing an action, each Controller first determines the list of available actions from its action set to choose a certain action. Since the Method isAvailable gets an state collection you don't have to use the model state, you also have acces to other modified states (for example a discrete state). The index of action can't be identified by the action itself, you need always an actionset to get the index of the action.

Constructor & Destructor Documentation

CAction::CAction CActionData actionData  )  [protected]
 
CAction::CAction  ) 
 
virtual CAction::~CAction  )  [virtual]
 

Member Function Documentation

void CAction::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.

virtual bool CAction::equals CAction action  )  [virtual]
 

Determines wether the 2 actions represent the same action.

Reimplemented in CContinuousAction, and CStaticContinuousAction.

virtual CActionData* CAction::getActionData  )  [virtual]
 

Returns an actiondata object initialised with the actions values.

The CActionData Object is created with new and must be deleted by the programmer!

virtual int CAction::getDuration  )  [inline, virtual]
 

returns the duration of the action, per default 1

Reimplemented in CMultiStepAction, and CPrimitiveAction.

virtual CActionData* CAction::getNewActionData  )  [virtual]
 

Returns an new CActionData object of the specific sub-class.

The CActionData Object is created with new and must be deleted by the programmer!

Reimplemented in CMultiStepAction, and CContinuousAction.

int CAction::getType  ) 
 
virtual bool CAction::isAvailable CStateCollection  )  [inline, virtual]
 

Reimplemented in CSubGoalBehaviour, and CStochasticModelAction.

virtual bool CAction::isSameAction CAction action,
CActionData data
[virtual]
 

Compares the action and the actionData obejcts.

Reimplemented in CContinuousAction, and CStaticContinuousAction.

bool CAction::isType int  type  ) 
 
virtual void CAction::loadActionData CActionData actionData  )  [virtual]
 

Set the changeable data according to the actiondata object.

Reimplemented in CContinuousAction, and CStaticContinuousAction.


Member Data Documentation

CActionData* CAction::actionData [protected]
 
int CAction::type [protected]
 

The type field is an integer, but it serves as a bitmask. So if you want to add an specific type to the Action you have to add it with an or mask. If you want to add a new general typ of Actions you have to create a new Typenumber. Since the bitmask only 2^n numbers are allowed.


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