Robot Simulator of the Robotics Group for Self-Organization of Control
0.8.0
|
Use this class to get discrete values. More...
#include <discretisizer.h>
Public Member Functions | |
Discretisizer (int numberBins) | |
call this constructor if you don't like to decide which range for the values are used, therefore the range ist found automatically. More... | |
Discretisizer (int numberBins, double minRange, double maxRange, bool mapToInterval) | |
call this constructor if you like to decide yourself which range for the values are used. More... | |
virtual | ~Discretisizer () |
virtual int | getBinNumber (double value) |
returns the given value as an discretisized integer. More... | |
virtual double | get (double value) |
returns the given value as an discretisized double. More... | |
virtual double | getMinRange () |
virtual double | getMaxRange () |
Protected Member Functions | |
virtual void | findMinAndMaxRange (double value) |
is used for automaticRange, sets min and max range. More... | |
virtual void | findMinAndMaxValues (double value) |
is used for mapToInterval, sets min and max values. More... | |
virtual int | discretisizeValue (double valueToDiscretisize) |
is used for discretisizing values More... | |
virtual int | roundValue (double valueToRound) |
Protected Attributes | |
int | numberBins |
bool | automaticRange |
double | minRange |
double | maxRange |
double | minValue |
double | maxValue |
bool | mapToInterval |
bool | firstStep |
Use this class to get discrete values.
If no intervalCount is set, the count=1. If no intervalRange is set, the range is automatically adjusted.
There are three possibilities:
Discretisizer | ( | int | numberBins | ) |
call this constructor if you don't like to decide which range for the values are used, therefore the range ist found automatically.
Note: The adjustment of the range is enabled, if this method is called.
numberBins | the number of bins "created" |
Discretisizer | ( | int | numberBins, |
double | minRange, | ||
double | maxRange, | ||
bool | mapToInterval | ||
) |
call this constructor if you like to decide yourself which range for the values are used.
The third parameter decides if the originally range should be completely mapped to the given interval range. If not, the values outside the given interval range are set to minRange respectively maxRange.
Note: The adjustment of the range is disabled, if this method is called.
numberBins | the number of bins "created" |
minRange | the minimum of the interval |
maxRange | the maximum of the interval |
mapToInterval | decides if all values are mapped to the given |
|
virtual |
|
protectedvirtual |
is used for discretisizing values
|
protectedvirtual |
is used for automaticRange, sets min and max range.
|
protectedvirtual |
is used for mapToInterval, sets min and max values.
|
virtual |
returns the given value as an discretisized double.
this method returns returns a value between minRange and maxRange
value | the value to discretisize |
|
virtual |
returns the given value as an discretisized integer.
this method returns a value between 0...numberbins-1.
value | the value to discretisize |
|
virtual |
|
virtual |
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |