Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NoiseGenerator Class Referenceabstract

Interface and basic class for noise generator. More...

#include <noisegenerator.h>

Inheritance diagram for NoiseGenerator:
Collaboration diagram for NoiseGenerator:

Public Member Functions

 NoiseGenerator ()
 
virtual ~NoiseGenerator ()
 
virtual void init (unsigned int dimension, RandGen *randGen=0)
 initialization with the the given dimension for multidimensional noise More...
 
virtual double generate ()=0
 generate somehow distributed random number parameterized with min and max. More...
 
virtual void add (double *value, double noiseStrength)
 adds multidimensional noise to the value field. More...
 
virtual unsigned int getDimension () const
 
virtual void setDimension (unsigned int dim)
 

Protected Member Functions

double uniform (double min=-0.1, double max=0.1)
 
double uniform01 ()
 

Protected Attributes

unsigned int dimension
 
RandGenrandGen
 
bool ownRandGen
 

Detailed Description

Interface and basic class for noise generator.

It is suitable for single noise channels but also multidimensional noise.

Constructor & Destructor Documentation

NoiseGenerator ( )
inline
virtual ~NoiseGenerator ( )
inlinevirtual

Member Function Documentation

virtual void add ( double *  value,
double  noiseStrength 
)
inlinevirtual

adds multidimensional noise to the value field.

Generic implementation calls generate for each channel. Overload this if you need different behavior.

Parameters
valuefield where noise is added. Must have length dimension (init())

Reimplemented in SineWhiteNoise, ColorNormalNoise, and ColorUniformNoise.

virtual double generate ( )
pure virtual

generate somehow distributed random number parameterized with min and max.

valid only for ONE random number, use add() for adding this kind of noise to several channels

Implemented in SineWhiteNoise, ColorNormalNoise, ColorUniformNoise, WhiteNormalNoise, WhiteUniformNoise, and NoNoise.

virtual unsigned int getDimension ( ) const
inlinevirtual
virtual void init ( unsigned int  dimension,
RandGen randGen = 0 
)
inlinevirtual

initialization with the the given dimension for multidimensional noise

Parameters
dimensiondimensionality of vectors to be used by add
randGenpointer to a random generator. If zero a new one generated internally
See Also
add()

Reimplemented in ColorNormalNoise, and ColorUniformNoise.

virtual void setDimension ( unsigned int  dim)
inlinevirtual
double uniform ( double  min = -0.1,
double  max = 0.1 
)
inlineprotected
double uniform01 ( )
inlineprotected

Member Data Documentation

unsigned int dimension
protected
bool ownRandGen
protected
RandGen* randGen
protected

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