Qualia  0.2
Public Member Functions | Public Attributes | List of all members
Action Class Reference

#include <Action.h>

Collaboration diagram for Action:
Collaboration graph
[legend]

Public Member Functions

 Action (ActionProperties *properties)
 Class constructor. More...
 
virtual ~Action ()
 Class destructor. More...
 
action_dim_toperator[] (int i) const
 Access operator. More...
 
virtual action_t conflated () const
 Returns the conflated representation of current action. More...
 
virtual ActionsetConflated (action_t action)
 Sets the action to the given conflated representation action. More...
 
bool undefined () const
 Returns true if this action is undefined (see Action::reset()). More...
 
virtual Actionreset ()
 
virtual bool hasNext ()
 True iff iterator has a next action. More...
 
virtual Actionnext ()
 
virtual ActioncopyFrom (const Action &src)
 Copies data from src. More...
 
unsigned int dim () const
 Dimension of actions. More...
 
unsigned long nConflated () const
 Number of conflated actions. More...
 
unsigned int nActions (int i) const
 Number of possible actions in dimension i. More...
 
virtual void saveData (XFile *file) const
 Save data to file (in binary format). More...
 
virtual void loadData (XFile *file)
 Loads data from file (in binary format). Dimension needs to be known in advance. More...
 

Public Attributes

ActionPropertiesproperties
 Pointer to the action properties (read-only). More...
 
action_dim_tactions
 The array containing the actions (of size dim()). More...
 
bool _undefined
 Reset flag. More...
 

Detailed Description

Represent an agent action. Actions in Qualia are always discrete. A specific action has two representations:

  1. A multi-dimensional array of integers (each of type action_dim_t)
  2. A single integer (conflated representation, of type action_t)

Meta-informations about the actions (dimensions and number of actions per dimension) are contained within an ActionProperties object that can be shared accross many actions.

Constructor & Destructor Documentation

Action::Action ( ActionProperties properties)

Class constructor.

Action::~Action ( )
virtual

Class destructor.

Member Function Documentation

action_t Action::conflated ( ) const
virtual

Returns the conflated representation of current action.

Action & Action::copyFrom ( const Action src)
virtual

Copies data from src.

unsigned int Action::dim ( ) const
inline

Dimension of actions.

bool Action::hasNext ( )
virtual

True iff iterator has a next action.

void Action::loadData ( XFile file)
virtual

Loads data from file (in binary format). Dimension needs to be known in advance.

unsigned int Action::nActions ( int  i) const
inline

Number of possible actions in dimension i.

unsigned long Action::nConflated ( ) const
inline

Number of conflated actions.

Action & Action::next ( )
virtual

Resets iterator. Typically equivalent to setConflated(getConflated()+1) (although subclasses can change that behavior).

action_dim_t& Action::operator[] ( int  i) const
inline

Access operator.

Action & Action::reset ( )
virtual

Resets iterator. Notice that this sets the action to be undefined until the first call to next().

void Action::saveData ( XFile file) const
virtual

Save data to file (in binary format).

Action & Action::setConflated ( action_t  action)
virtual

Sets the action to the given conflated representation action.

bool Action::undefined ( ) const
inline

Returns true if this action is undefined (see Action::reset()).

Member Data Documentation

bool Action::_undefined

Reset flag.

action_dim_t* Action::actions

The array containing the actions (of size dim()).

ActionProperties* Action::properties

Pointer to the action properties (read-only).


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