GClasses
GClasses::GDiscreteActionIterator Class Reference

Detailed Description

This is a simple and common action iterator that can be used when there is a discrete set of possible actions.

#include <GPolicyLearner.h>

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

Public Member Functions

 GDiscreteActionIterator (int action_count)
 
virtual ~GDiscreteActionIterator ()
 
virtual int actionCount ()
 Returns the total number of action values. More...
 
virtual int actionDims ()
 Returns 1. More...
 
virtual bool nextAction (double *pOutAction)
 Iterates to the next action. Returns false if there are no more. More...
 
virtual void randomAction (double *pOutAction, GRand *pRand)
 Returns a random action. More...
 
virtual void reset (const double *pState)
 Resets the iterator. More...
 
- Public Member Functions inherited from GClasses::GAgentActionIterator
 GAgentActionIterator ()
 
virtual ~GAgentActionIterator ()
 

Protected Attributes

int m_action
 
int m_count
 

Constructor & Destructor Documentation

GClasses::GDiscreteActionIterator::GDiscreteActionIterator ( int  action_count)
inline
virtual GClasses::GDiscreteActionIterator::~GDiscreteActionIterator ( )
inlinevirtual

Member Function Documentation

virtual int GClasses::GDiscreteActionIterator::actionCount ( )
inlinevirtual

Returns the total number of action values.

Implements GClasses::GAgentActionIterator.

virtual int GClasses::GDiscreteActionIterator::actionDims ( )
inlinevirtual

Returns 1.

Implements GClasses::GAgentActionIterator.

virtual bool GClasses::GDiscreteActionIterator::nextAction ( double *  pOutAction)
virtual

Iterates to the next action. Returns false if there are no more.

Implements GClasses::GAgentActionIterator.

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

Returns a random action.

Implements GClasses::GAgentActionIterator.

virtual void GClasses::GDiscreteActionIterator::reset ( const double *  pState)
virtual

Resets the iterator.

Implements GClasses::GAgentActionIterator.

Member Data Documentation

int GClasses::GDiscreteActionIterator::m_action
protected
int GClasses::GDiscreteActionIterator::m_count
protected