Discretisizer Class Reference

Use this class to get discrete values. More...

#include <discretisizer.h>

List of all members.

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.
 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.
virtual ~Discretisizer ()
virtual int getBinNumber (double value)
 returns the given value as an discretisized integer.
virtual double get (double value)
 returns the given value as an discretisized double.
virtual double getMinRange ()
virtual double getMaxRange ()

Protected Member Functions

virtual void findMinAndMaxRange (double value)
 is used for automaticRange, sets min and max range.
virtual void findMinAndMaxValues (double value)
 is used for mapToInterval, sets min and max values.
virtual int discretisizeValue (double valueToDiscretisize)
 is used for discretisizing values
virtual int roundValue (double valueToRound)

Protected Attributes

int numberBins
bool automaticRange
double minRange
double maxRange
double minValue
double maxValue
bool mapToInterval
bool firstStep


Detailed Description

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: 1. automaticRange=true --> mapping is always disabled 2. automaticRange=false, mapToInterval=true --> real (found) range is mapped to specified range 3. automaticRange=false, mapToInterval=false --> no mapping, no range adjustment, values outside the specified range are set to minRange respectively maxRange


Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
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

~Discretisizer (  )  [virtual]


Member Function Documentation

int discretisizeValue ( double  valueToDiscretisize  )  [protected, virtual]

is used for discretisizing values

void findMinAndMaxRange ( double  value  )  [protected, virtual]

is used for automaticRange, sets min and max range.

void findMinAndMaxValues ( double  value  )  [protected, virtual]

is used for mapToInterval, sets min and max values.

double get ( double  value  )  [virtual]

returns the given value as an discretisized double.

this method returns returns a value between minRange and maxRange

Parameters:
value the value to discretisize
Returns:
discretisized value between minRange and maxRange

int getBinNumber ( double  value  )  [virtual]

returns the given value as an discretisized integer.

this method returns a value between 0...numberbins-1.

Parameters:
value the value to discretisize
Returns:
the bin number

double getMaxRange (  )  [virtual]

double getMinRange (  )  [virtual]

int roundValue ( double  valueToRound  )  [protected, virtual]


Member Data Documentation

bool automaticRange [protected]

bool firstStep [protected]

bool mapToInterval [protected]

double maxRange [protected]

double maxValue [protected]

double minRange [protected]

double minValue [protected]

int numberBins [protected]


The documentation for this class was generated from the following files:
Generated on Fri Oct 30 16:29:02 2009 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.4.7