CAdaptiveParameterBoundedValuesCalculator Class Reference
Super
class for all classes which use bounded target values.
More...
#include <cparameters.h>
Inheritance diagram for
CAdaptiveParameterBoundedValuesCalculator:
List of all members.
Detailed Description
Super class for all classes which use bounded target values.
The subclasses of theses class use bounded target values. These
are for example the average reward or the value of a V-Function.
For Bounded Target values you can define a minimum and a maximum
value of the target (Parameters: "APTargetMin", "APTargetMax"). For
example if the reward is supposed to be between -1 and 0 you can
define these values as minimum and maximum target values for the
average reward adaptive parameter calculator. The intervall
[targetmin, targetmax] of the target value gets normalized to the
intervall [0,1]. This intervall can be scaled by the parameter
"APTargetScale". After the normalization the function defined by
the parameter functionKind gets applied. The 6 different functions
are calucalated the following way:
- LINEAR: f(x) = x
- SQUARE: f(x) = x^2
- LOG: f(x) = log(x * targetScale + 1.0) / log(1.0 +
targetScale);
- FRACT: f(x) = f(x) = (1.0 / (x * targetScale + 1.0) - 1.0 /
(targetScale + 1.0)) * (1.0 + targetScale) /targetScale;
- FRACTSQUARE: f(x) = (1.0 / (x^2* targetScale^2 + 1.0) - 1.0 /
(targetScale^2 + 1.0)) * (1.0 + targetScale^2) /targetScale^2;
- FRACTLOG : offset = 1.0 / (1.0 + log(1.0 + targetScale)); f(x)
= (1.0 / (1.0 + log(x * targetScale + 1.0)) - offset) / (1 -
offset); All the functions are scaled so that there function values
are again in the intervall [0,1]. So scaling the targetintervall is
only useful if log or fract functions are used (so you can set the
steepness of the slope of this functions). The result can be
inverted (1 - x) if the Parameter "APInvertTargetFunction" is true
(1.0). This value is now scaled ("APParamScale") and an offset gets
added ("APParamOffset"), so the resulting parameter value is
calculated with the formular param = param_offset + param_scale *
f(normalized_targetvalue), resp. param = param_offset + param_scale
* (1 - f(normalized_targetvalue)). These gives you much degree of
freedom to design your adaptive parameter calculator. The values of
the parameters "APInvertTargetFunction", "APParamScale",
"APParamOffset", APTargetMin" and "APTargetMax" are again stored in
own data element for performance reasons and updated by the
function onParameterChanged. See the subclasses for the different
target values. Parameters of
CAdaptiveParameterBoundedValuesCalculator:
- "APFunctionKind": Defining the function to transform target
value into the parameter value.
- "APInvertTargetFunction": Boolean value wether to invert target
function or not
- "APParamScale": Scale of the parameter value
- "APParamOffset": Parameter Value offset
- "APTargetMin": Minimum value of the target
- "APTargetMax": Maximum value of the target
- "APTargetScale": Scale for the targetValue, so the targetValue
is in the intervall [0, targetScale].
Constructor & Destructor Documentation
|
CAdaptiveParameterBoundedValuesCalculator::CAdaptiveParameterBoundedValuesCalculator
|
( |
CParameters *
|
targetObject,
|
|
|
string |
targetParameter,
|
|
|
int |
functionKind,
|
|
|
double |
paramOffset,
|
|
|
double |
paramScale,
|
|
|
double |
targetMin,
|
|
|
double |
targetMax |
|
) |
|
|
| virtual
CAdaptiveParameterBoundedValuesCalculator::~CAdaptiveParameterBoundedValuesCalculator
|
( |
|
) |
[virtual] |
|
Member Function Documentation
| virtual void
CAdaptiveParameterBoundedValuesCalculator::onParametersChanged
|
( |
|
) |
[virtual] |
|
| virtual void
CAdaptiveParameterBoundedValuesCalculator::setParameterValue
|
( |
double |
value |
) |
[virtual] |
|
| |
Returns the value of the parameter.
The value of the parameter is calculated the follwing way:
- param = param_offset + param_scale *
f(normalized_targetvalue)
- param = param_offset + param_scale * (1 -
f(normalized_targetvalue)) for inverted function values
(APInvertTargetFunction) For more details see class
description.
Reimplemented from CAdaptiveParameterCalculator.
|
Member Data Documentation
The documentation for this class was generated from the following
file:
|