Reinforcement Learning Toolbox 2.0
last updated:
General
Documentation
Manual
Tutorial
Class Reference
Master Thesis
Examples
Related Papers
Downloads
Links
News
mailto:webmaster
Main Page     Class Hierarchy   Compound List   File List   Compound Members   File Members

CAbstractQFunction Class Reference

Interface for all Q-Functions. More...

#include <cqfunction.h>

Inheritance diagram for CAbstractQFunction:

CActionObject CLearnDataObject CParameterObject CParameters CContinuousTimeQFunctionFromTransitionFunction CExplorationQFunction CGradientQFunction CQFunctionFromStochasticModel CQFunctionFromTransitionFunction CQFunctionSum CUnknownDataQFunction CUnknownDataQFunctionFromLocalRBFRegression List of all members.


Public Member Functions

int  getType ()
bool  isType (int type)
void  addType (int Type)
  CAbstractQFunction (CActionSet *actions)
  Creates a QFunction, handling Q-Values for all actions in the actionset.

virtual  ~CAbstractQFunction ()
virtual void  saveData (FILE *file)
virtual void  loadData (FILE *file)
virtual void  printValues ()
virtual void  resetData ()
void  getActionValues (CStateCollection *state, CActionSet *actions, double *actionValues, CActionDataSet *data=NULL)
  Writes the Q-Values of the specified actions in the actionValues array.

virtual CAction getMax (CStateCollection *state, CActionSet *availableActions, CActionDataSet *data=NULL)
  Calculates the best action from a given action set.

virtual double  getMaxValue (CStateCollection *state, CActionSet *availableActions)
  Returns the best action value from a given action set.

virtual void  getStatistics (CStateCollection *state, CAction *action, CActionSet *actions, CActionStatistics *statistics)
  Returns the statistics for a given action.

virtual void  updateValue (CStateCollection *, CAction *, double, CActionData *=NULL)
  Interface for updating a Q-Value.

virtual void  setValue (CStateCollection *state, CAction *action, double qValue, CActionData *data=NULL)
  Interface for setting a Q-Value.

virtual double  getValue (CStateCollection *state, CAction *action, CActionData *data=NULL)=0
  Interface for getting a Q-Value.

virtual CAbstractQETraces getStandardETraces ()


Public Attributes

bool  mayDiverge


Protected Attributes

int  type

Detailed Description

Interface for all Q-Functions.

Q-Functions depend on the state and the action you can choose in the current state, so the policy is able to decide which action is best (usually the action with the highest Q-Value). CAbstractQFunction is the base class of all Q-Functions. It just provides the interface for getting, setting and updating (adding a value to the current value) Q-Values. These functions are again getValue, setValue and updateValue, now there is always an action object as additional parameter. The class maintains an action set of all actions which are stored in the Q-Function. In addition the class provides one function to retrieve the action with the best Q-Value (getMax), one function for retrieving the value of these best action (getMaxValue) and there is also a function which writes all Q-Values of a state (i.e. for all actions) in a double array (getActionValues).

The class also maintains a gamma factor which should be the same as the gamma factor of its value functions. In addition the interface provides functions for storing and loading the Values of the QFunction (storeValues and loadValues).
See also:
CQFunction

Constructor & Destructor Documentation

CAbstractQFunction::CAbstractQFunction CActionSet actions  ) 
 

Creates a QFunction, handling Q-Values for all actions in the actionset.

virtual CAbstractQFunction::~CAbstractQFunction  )  [virtual]
 

Member Function Documentation

void CAbstractQFunction::addType int  Type  ) 
 
void CAbstractQFunction::getActionValues CStateCollection state,
CActionSet actions,
double *  actionValues,
CActionDataSet data = NULL
 

Writes the Q-Values of the specified actions in the actionValues array.

so the size of the array has to be at least the size of the action set.

Reimplemented in CContinuousTimeQFunctionFromTransitionFunction.

virtual CAction* CAbstractQFunction::getMax CStateCollection state,
CActionSet availableActions,
CActionDataSet data = NULL
[virtual]
 

Calculates the best action from a given action set.

Returns the best action from the availableActions action set. If several actions have the same best Q-Value, the first action which has this value in the action set is choosen.

Reimplemented in CContinuousActionQFunction.

virtual double CAbstractQFunction::getMaxValue CStateCollection state,
CActionSet availableActions
[virtual]
 

Returns the best action value from a given action set.

Returns the best action value from the availableActions action set.

virtual CAbstractQETraces* CAbstractQFunction::getStandardETraces  )  [inline, virtual]
 

Reimplemented in CCALinearFAQFunction, CExplorationQFunction, CQFunctionSum, CGradientQFunction, CQFunction, CQFunctionFromStochasticModel, CComposedQFunction, CQFunctionFromTransitionFunction, and CContinuousTimeQFunctionFromTransitionFunction.

virtual void CAbstractQFunction::getStatistics CStateCollection state,
CAction action,
CActionSet actions,
CActionStatistics statistics
[virtual]
 

Returns the statistics for a given action.

Reimplemented in CComposedQFunction.

int CAbstractQFunction::getType  ) 
 
virtual double CAbstractQFunction::getValue CStateCollection state,
CAction action,
CActionData data = NULL
[pure virtual]
 

Interface for getting a Q-Value.

Implemented in CContinuousActionQFunction, CExplorationQFunction, CQFunctionSum, CQFunction, CQFunctionFromStochasticModel, CComposedQFunction, CQFunctionFromTransitionFunction, CContinuousTimeQFunctionFromTransitionFunction, CUnknownDataQFunction, and CUnknownDataQFunctionFromLocalRBFRegression.

bool CAbstractQFunction::isType int  type  ) 
 
virtual void CAbstractQFunction::loadData FILE *  file  )  [virtual]
 

Implements CLearnDataObject.

Reimplemented in CGradientQFunction, CQFunction, and CComposedQFunction.

virtual void CAbstractQFunction::printValues  )  [inline, virtual]
 

Reimplemented in CQFunction, and CComposedQFunction.

virtual void CAbstractQFunction::resetData  )  [inline, virtual]
 

Implements CLearnDataObject.

Reimplemented in CGradientQFunction, CQFunction, CComposedQFunction, CQFunctionFromGradientFunction, CUnknownDataQFunction, and CRegressionTreeQFunction.

virtual void CAbstractQFunction::saveData FILE *  file  )  [virtual]
 

Implements CLearnDataObject.

Reimplemented in CGradientQFunction, CQFunction, and CComposedQFunction.

virtual void CAbstractQFunction::setValue CStateCollection state,
CAction action,
double  qValue,
CActionData data = NULL
[virtual]
 

Interface for setting a Q-Value.

Reimplemented in CContinuousActionQFunction, CExplorationQFunction, CQFunction, CQFunctionFromStochasticModel, CComposedQFunction, CQFunctionFromTransitionFunction, and CContinuousTimeQFunctionFromTransitionFunction.

virtual void CAbstractQFunction::updateValue CStateCollection ,
CAction ,
double  ,
CActionData = NULL
[inline, virtual]
 

Interface for updating a Q-Value.

Reimplemented in CContinuousActionQFunction, CExplorationQFunction, CGradientQFunction, CQFunction, CQFunctionFromStochasticModel, CComposedQFunction, CQFunctionFromTransitionFunction, and CContinuousTimeQFunctionFromTransitionFunction.


Member Data Documentation

bool CAbstractQFunction::mayDiverge
 
int CAbstractQFunction::type [protected]
 

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