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

CFunctionComperator Class Reference

Super class of the V-Function Comperators and Q-Function comperators. More...

#include <canalyzer.h>

Inheritance diagram for CFunctionComperator:

CRewardFunction CQFunctionComperator CVFunctionComperator List of all members.


Public Member Functions

  CFunctionComperator (CStateProperties *modelState, std::list< CStateModifier * > *modifiers)
  The comperator needs the properties of the model state and all modifiers the 2 functions use.

virtual  ~CFunctionComperator ()
double  compareFunctionsRandom (int nSamples, int errorFunction=1)
  Compares the 2 functions for nSamples random states.

double  compareFunctionsStates (CStateList *states, int errorFunction=1)
  Compares the 2 functions for every state in the state list.

double  getReward (CStateCollection *oldState, CAction *action, CStateCollection *newState)
  Virtual function for calculating the reward.



Protected Member Functions

virtual double  getValue (int numFunc, CStateCollection *state)=0
  Get the value of the numFunc function for the given state.

virtual double  getDifference (CStateCollection *state, int errorFunction)
  get the difference of the 2 functions for the given state, use the given errorfunction

void  getRandomState (CState *state)
  returns a random state



Protected Attributes

CStateProperties modelStateProperties
CStateCollectionImpl stateCollection

Detailed Description

Super class of the V-Function Comperators and Q-Function comperators.

Function comperators calculate the difference between 2 V-Functions or Q-Functions. You have2 possibilities to do this:

  • calculate the difference for N random states (with compareFunctionsRandom)
  • calculate the difference for a given state list (with compareFunctionsStates)

For each of these 2 functions you can define the errorfunction which should be used. There are 3 different kinds of errorfunctions:

  • MSE: calculate the mean squared error between the 2 functions
  • MAE: calculate the mean average error between the 2 functions
  • MAXERROR : calculate the maximum error between the 2 functions

Constructor & Destructor Documentation

CFunctionComperator::CFunctionComperator CStateProperties modelState,
std::list< CStateModifier * > *  modifiers
 

The comperator needs the properties of the model state and all modifiers the 2 functions use.

It is recommended to take the agent's state modifiers (agent->getStateModifiers();).

virtual CFunctionComperator::~CFunctionComperator  )  [virtual]
 

Member Function Documentation

double CFunctionComperator::compareFunctionsRandom int  nSamples,
int  errorFunction = 1
 

Compares the 2 functions for nSamples random states.

For more details about the errorfunction see the class description.

double CFunctionComperator::compareFunctionsStates CStateList states,
int  errorFunction = 1
 

Compares the 2 functions for every state in the state list.

For more details about the errorfunction see the class description.

virtual double CFunctionComperator::getDifference CStateCollection state,
int  errorFunction
[protected, virtual]
 

get the difference of the 2 functions for the given state, use the given errorfunction

void CFunctionComperator::getRandomState CState state  )  [protected]
 

returns a random state

double CFunctionComperator::getReward CStateCollection oldState,
CAction action,
CStateCollection newState
[virtual]
 

Virtual function for calculating the reward.

Implements CRewardFunction.

virtual double CFunctionComperator::getValue int  numFunc,
CStateCollection state
[protected, pure virtual]
 

Get the value of the numFunc function for the given state.

Implemented in CVFunctionComperator, and CQFunctionComperator.


Member Data Documentation

CStateProperties* CFunctionComperator::modelStateProperties [protected]
 
CStateCollectionImpl* CFunctionComperator::stateCollection [protected]
 

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