CAbstractQFunction Class Reference
Interface
for all Q-Functions. More...
#include <cqfunction.h>
Inheritance diagram for CAbstractQFunction:
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 |
) |
|
|
| |
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.
|
| |
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] |
|
| int
CAbstractQFunction::getType
|
( |
|
) |
|
|
| bool
CAbstractQFunction::isType
|
( |
int |
type |
) |
|
|
| virtual void
CAbstractQFunction::loadData
|
( |
FILE * |
file |
) |
[virtual] |
|
| virtual void
CAbstractQFunction::printValues
|
( |
|
) |
[inline,
virtual] |
|
| virtual void
CAbstractQFunction::resetData
|
( |
|
) |
[inline,
virtual] |
|
| virtual void
CAbstractQFunction::saveData
|
( |
FILE * |
file |
) |
[virtual] |
|
Member Data Documentation
The documentation for this class was generated from the following
file:
|