CAction Class Reference
Class Representing an action the
agent or any other SMDP can choose from.
More...
#include <caction.h>
Inheritance diagram for CAction:
List of all members.
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] |
|
| 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] |
|
| 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] |
|
| virtual CActionData*
CAction::getNewActionData
|
( |
|
) |
[virtual] |
|
| bool
CAction::isType
|
( |
int |
type |
) |
|
|
| virtual void
CAction::loadActionData
|
( |
CActionData *
|
actionData |
) |
[virtual] |
|
Member Data Documentation
| |
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:
|