GClasses
GClasses::GAgentActionIterator Class Referenceabstract

Detailed Description

Iterates through all the actions that are valid in the current state. If actions are continuous or very numerous, this should sample valid actions in a random order. The caller may decide that it has sampled enough at any time.

#include <GPolicyLearner.h>

Inheritance diagram for GClasses::GAgentActionIterator:
GClasses::GDiscreteActionIterator

Public Member Functions

 GAgentActionIterator ()
 
virtual ~GAgentActionIterator ()
 
virtual int actionCount ()=0
 Returns the number of actions. If actions are continuous, this should return 0x7fffffff. (If actions are state-dependent, it should return the total number of possible unique actions unioned over all states.) More...
 
virtual int actionDims ()=0
 Returns the number of dimensions in the action vector. More...
 
virtual bool nextAction (double *pOutAction)=0
 Returns false if there are no more available actions. More...
 
virtual void randomAction (double *pOutAction, GRand *pRand)=0
 Produces a random action. More...
 
virtual void reset (const double *pState)=0
 Prepares to begin iterating over actions. (Note that this is not called by the constructor, so you should even call Reset the first time you iterate over the actions.) If the set of available actions is not state-dependent, this should simply ignore the pState parameter. More...
 

Constructor & Destructor Documentation

GClasses::GAgentActionIterator::GAgentActionIterator ( )
inline
virtual GClasses::GAgentActionIterator::~GAgentActionIterator ( )
inlinevirtual

Member Function Documentation

virtual int GClasses::GAgentActionIterator::actionCount ( )
pure virtual

Returns the number of actions. If actions are continuous, this should return 0x7fffffff. (If actions are state-dependent, it should return the total number of possible unique actions unioned over all states.)

Implemented in GClasses::GDiscreteActionIterator.

virtual int GClasses::GAgentActionIterator::actionDims ( )
pure virtual

Returns the number of dimensions in the action vector.

Implemented in GClasses::GDiscreteActionIterator.

virtual bool GClasses::GAgentActionIterator::nextAction ( double *  pOutAction)
pure virtual

Returns false if there are no more available actions.

Implemented in GClasses::GDiscreteActionIterator.

virtual void GClasses::GAgentActionIterator::randomAction ( double *  pOutAction,
GRand pRand 
)
pure virtual

Produces a random action.

Implemented in GClasses::GDiscreteActionIterator.

virtual void GClasses::GAgentActionIterator::reset ( const double *  pState)
pure virtual

Prepares to begin iterating over actions. (Note that this is not called by the constructor, so you should even call Reset the first time you iterate over the actions.) If the set of available actions is not state-dependent, this should simply ignore the pState parameter.

Implemented in GClasses::GDiscreteActionIterator.