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

CSemiMDPLastNRewardFunction Class Reference

Reward Function for Behaviours. More...

#include <crewardmodel.h>

Inheritance diagram for CSemiMDPLastNRewardFunction:

CRewardFunction CRewardEpisode CSemiMDPRewardListener CSemiMDPListener CParameterObject CParameters List of all members.


Public Member Functions

  CSemiMDPLastNRewardFunction (CRewardFunction *rewardFunction, double gamma)
  Creates the reward function with the discount factor gamma.

virtual  ~CSemiMDPLastNRewardFunction ()
virtual double  getReward (CStateCollection *oldState, CAction *action, CStateCollection *newState)
  Calculates the reward for extended actions.



Protected Attributes

double  gamma
  The discount factor.


Detailed Description

Reward Function for Behaviours.

Very often the reward of a behaviour consists of the summud up rewards from the primitiv actions which were executed during the behaviour was activ. The class CSemiMDPLastNRewardFunction does this reward calculation. It is a subclass of CRewardEpisode, so it mantains a reward array containing all rewards from the past. The function getReward(CStateCollection *oldState, CAction *action, CStateCollection *newState). For an action of duration d, the function calculates the reward of the transition by sum_{i=0}^{d-1} gamma^i * r(N-i). The discount factor is needed since the reward from the past has to be weakened by this factor.

Since the object has to have access to the past "primitiv" rewards, it has to be added to the listener list of the agent.


Constructor & Destructor Documentation

CSemiMDPLastNRewardFunction::CSemiMDPLastNRewardFunction CRewardFunction rewardFunction,
double  gamma
 

Creates the reward function with the discount factor gamma.

virtual CSemiMDPLastNRewardFunction::~CSemiMDPLastNRewardFunction  )  [virtual]
 

Member Function Documentation

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

Calculates the reward for extended actions.

For an action of duration d, the function the reward is calculated by sum_{i=0}^{d-1} gamma^i * r(N-i). The discount factor is needed since the reward from the past has to be weakened by this factor.

Implements CRewardFunction.


Member Data Documentation

double CSemiMDPLastNRewardFunction::gamma [protected]
 

The discount factor.


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