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

CParameterObject Class Reference

Super class of all Objects mantaining parameters. More...

#include <cparameters.h>

Inheritance diagram for CParameterObject:

CParameters CAbstractBetaCalculator CAbstractQETraces CAbstractVETraces CActionDistribution CAdaptiveEtaCalculator CAdaptiveParameterCalculator CAgentController CBatchDataGenerator CCAGradientPolicyInputDerivationCalculator CDataCollector CErrorListener CExtraRegressionForestTrainer CGradientCalculator CGradientFunctionUpdater CGradientLearner CGradientUpdateFunction CLearnDataObject CLeastSquaresLearner CMonteCarloError CPolicyEvaluation CPolicyIteration CReinforcementBaseLineCalculator CResidualGradientFunction CSemiMDPListener CSupervisedLearner CSupervisedQFunctionLearner CSupervisedQFunctionWeightedLearner CSupervisedWeightedLearner CTestSuite CTestSuiteEvaluator CTransitionFunction CTransitionFunctionInputDerivationCalculator CValueIteration CVFunctionInputDerivationCalculator List of all members.


Public Member Functions

  CParameterObject ()
virtual  ~CParameterObject ()
virtual void  onParametersChanged ()
  Interface for faster parameter handling (see description of the class).

virtual void  setParameter (string name, double value)
  sets the parameter and calls parametersChanged

virtual void  setParameters (CParameters *parameters)
  sets the parameters and calls parametersChanged

virtual void  addParameters (CParameterObject *parameters, string prefix="")
  Add all parameters of the given parameter object to the current object, also add the given parameter object to the parameter object list.

virtual double  getParameter (string name)
  Returns the parameters value.

virtual bool  operator== (CParameters &parameters)
  returns true if all parameters are the same



Protected Types

typedef std::pair< CParameterObject *,

string > 
paramPair


Protected Member Functions

void  parametersChanged ()
  informs all parameter objects from the list and calls onParametersChanged



Protected Attributes

std::list< paramPair > *  parameterObjects

Detailed Description

Super class of all Objects mantaining parameters.

This class provides full parameter handling support for all its subclasses. Additionally to the functionality of the CParameters class, this class supports adding parameters of other CParameterObject's to the parameter set. The difference to normal to adding normal CParameter objects is, that if the parameter of the current object changes, all parameter objects which have been added by addParameters will get informed about the changed parameter. So if several objects have the same parameter you only have to set it once. Therefore the class contains a parameter object list to inform the other parameter objects In the toolbox all parameter objects which are data elements of another parameter object get added to the parameter object itself, so all parameters of the data elements are parameters of the new class too. So for example the TD-Learner class contains the parameter "Lambda", even though this parameter initially belonged to the etrace object of the learner. If we change the parameter "Lambda" of the TD-Learner, it will also change the parameter "Lambda" for its etrace object. If 2 or more data elements have the same parameter, they can only have the same parameter value, because all of the parameter objects get informed about a parameter change. If this isn't desired, you can specify a parameter name prefix, when adding the parameter object to your new class. This Prefix is used to distinguish between the same parameter names of the parameter objects. Per default no prefix is used. An additional functionality of parameter objects are adaptive paramter. For each parameter you can specify an adaptive parameter calculator, which calculates the parameter value each time it is retrieved. Now, each time the parameter's value is requested by "getParameter" the calculated value of the adaptive parameter calculator is returned instead of the constant double value of the parameter map. This is useful for example for adapting the learning rate or the exploration of a policy. The parameter's value can depend on any other value like the number of steps or episodes or even the current average reward. (see CAdaptiveParameterCalculator). Be aware that the adaptive parameter calculator is always set only for current object in the parameter object hierarchy. So if you set an adaptive parameter for the Parameter "Lambda" in a TD-Learner object, it won't affect the etraces, where the paremeter initially belong. So you have to set the adaptive parameter for the etrace object directly. For performance reasons the parameter object subclasses have the possibility to not use the parameter set everytime they want to retrieve the parameters value, therefore they can store the parameters in double values, and each time a parameter value changes, they get informed by the function onParametersChanged. So this function has to be overwritten to update the double values if this is needed.


Member Typedef Documentation

typedef std::pair<CParameterObject *, string> CParameterObject::paramPair [protected]
 

Constructor & Destructor Documentation

CParameterObject::CParameterObject  ) 
 
virtual CParameterObject::~CParameterObject  )  [virtual]
 

Member Function Documentation

virtual void CParameterObject::addParameters CParameterObject parameters,
string  prefix = ""
[virtual]
 

Add all parameters of the given parameter object to the current object, also add the given parameter object to the parameter object list.

All parameters of the given object gets added with the prefix to the parameter set.

virtual double CParameterObject::getParameter string  name  )  [virtual]
 

Returns the parameters value.

If there is the specified parameter is not adaptive, the function returns the constant parameter value (see CParameters). Otherwise the value is calculated by the adaptive parameter calculator.

Reimplemented from CParameters.

virtual void CParameterObject::onParametersChanged  )  [inline, virtual]
 

Interface for faster parameter handling (see description of the class).

Reimplemented in CAdaptiveParameterFromNStepsCalculator, CAdaptiveParameterFromNEpisodesCalculator, CAdaptiveParameterFromAverageRewardCalculator, CFittedIteration, CContinuousActionRandomPolicy, CAdaptiveParameterCalculator, CAdaptiveParameterBoundedValuesCalculator, CAdaptiveParameterUnBoundedValuesCalculator, CQAverageTDErrorLearner, CUnknownDataQFunction, CAdaptiveParameterFromValueCalculator, and CVAverageTDErrorLearner.

virtual bool CParameterObject::operator== CParameters parameters  )  [virtual]
 

returns true if all parameters are the same

The parameters constant value is used again.

Reimplemented from CParameters.

void CParameterObject::parametersChanged  )  [protected]
 

informs all parameter objects from the list and calls onParametersChanged

virtual void CParameterObject::setParameter string  name,
double  value
[virtual]
 

sets the parameter and calls parametersChanged

Reimplemented from CParameters.

Reimplemented in CPendulumModel.

virtual void CParameterObject::setParameters CParameters parameters  )  [virtual]
 

sets the parameters and calls parametersChanged

Reimplemented from CParameters.


Member Data Documentation

std::list<paramPair>* CParameterObject::parameterObjects [protected]
 

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