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

CFeatureStateRewardModel Class Reference

#include <crewardmodel.h>

Inheritance diagram for CFeatureStateRewardModel:

CFeatureRewardFunction CSemiMDPRewardListener CLearnDataObject CRewardFunction CStateObject CSemiMDPListener CParameterObject CParameterObject CParameters CParameters List of all members.


Public Member Functions

  CFeatureStateRewardModel (CRewardFunction *function, CStateModifier *discretizer)
  Creates a reward model, which uses an estimated model for the calculation of the transition visits.

virtual  ~CFeatureStateRewardModel ()
  Creates a reward model, which has to use an own visit table for the visits.

virtual double  getReward (CState *oldState, CAction *action, CState *newState)
  Calls getReward(int oldState, CAction *action, int newState) with the features from the state as argument.

virtual double  getReward (int oldState, CAction *action, int newState)
  Returns the reward for a specific discrete state transition.

virtual double  getReward (int newState)
virtual void  nextStep (CStateCollection *oldState, CAction *action, double reward, CStateCollection *newState)
  virtual function, to be implemented by subclass

virtual void  saveData (FILE *stream)
  Saves the reward model.

virtual void  loadData (FILE *stream)
virtual void  resetData ()


Protected Attributes

double *  rewards
double *  visits
double  rewardMean
int  numRewards

Constructor & Destructor Documentation

CFeatureStateRewardModel::CFeatureStateRewardModel CRewardFunction function,
CStateModifier discretizer
 

Creates a reward model, which uses an estimated model for the calculation of the transition visits.

It is very important that the estimated model contains the same transitions as the reward table, because otherwise a division by zero would occur. So the estimated model has to be added before the reward model to the listener.

virtual CFeatureStateRewardModel::~CFeatureStateRewardModel  )  [virtual]
 

Creates a reward model, which has to use an own visit table for the visits.


Member Function Documentation

virtual double CFeatureStateRewardModel::getReward int  newState  )  [virtual]
 
virtual double CFeatureStateRewardModel::getReward int  oldState,
CAction action,
int  newState
[virtual]
 

Returns the reward for a specific discrete state transition.

Calculates the mean reward from that transition, i.e. sum rewards/sum visits

Implements CFeatureRewardFunction.

virtual double CFeatureStateRewardModel::getReward CState oldState,
CAction action,
CState newState
[virtual]
 

Calls getReward(int oldState, CAction *action, int newState) with the features from the state as argument.

The state has to be a feature state, this state gets decomposed into his features, the reward for the features is calculated and summed up wheighted with the feature factors.

Reimplemented from CFeatureRewardFunction.

virtual void CFeatureStateRewardModel::loadData FILE *  stream  )  [virtual]
 

Loads the reward Table and the visit table if no estimated model was assigned to the constructor

Implements CLearnDataObject.

virtual void CFeatureStateRewardModel::nextStep CStateCollection oldState,
CAction action,
double  reward,
CStateCollection newState
[virtual]
 

virtual function, to be implemented by subclass

Reimplemented from CSemiMDPRewardListener.

virtual void CFeatureStateRewardModel::resetData  )  [virtual]
 

Implements CLearnDataObject.

virtual void CFeatureStateRewardModel::saveData FILE *  stream  )  [virtual]
 

Saves the reward model.

Saves the reward Table and the visit table if it is used

Implements CLearnDataObject.


Member Data Documentation

int CFeatureStateRewardModel::numRewards [protected]
 
double CFeatureStateRewardModel::rewardMean [protected]
 
double* CFeatureStateRewardModel::rewards [protected]
 
double* CFeatureStateRewardModel::visits [protected]
 

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