GClasses

GClasses::GAgentActionIterator Class Reference

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. More...

#include <GPolicyLearner.h>

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

List of all members.

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.)
virtual int actionDims ()=0
 Returns the number of dimensions in the action vector.
virtual void randomAction (double *pOutAction, GRand *pRand)=0
 Produces a random action.
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.
virtual bool nextAction (double *pOutAction)=0
 Returns false if there are no more available actions.

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.


Constructor & Destructor Documentation

GClasses::GAgentActionIterator::GAgentActionIterator ( ) [inline]
virtual GClasses::GAgentActionIterator::~GAgentActionIterator ( ) [inline, virtual]

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.