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
DoubleRandomStrategy Class Reference

This class create a IValue (TemplateValue with type double) and initialize it with an random double value. More...

#include <DoubleRandomStrategy.h>

Inheritance diagram for DoubleRandomStrategy:
Collaboration diagram for DoubleRandomStrategy:

Public Member Functions

 DoubleRandomStrategy (RandGen *random, double base=0.0, double factor=1.0, double epsilon=0.0)
 The constructor. More...
 
virtual ~DoubleRandomStrategy ()
 default destructor More...
 
virtual IValuegetRandomValue (void)
 implementation for the interface. More...
 
- Public Member Functions inherited from IRandomStrategy
 IRandomStrategy ()
 default constructor More...
 
virtual ~IRandomStrategy ()
 default destructor More...
 

Protected Attributes

RandGenm_random
 the random generator More...
 
double m_base
 base parameter. More...
 
double m_factor
 factor parameter. More...
 
double m_epsilon
 epsilon parameter. More...
 

Detailed Description

This class create a IValue (TemplateValue with type double) and initialize it with an random double value.

The value have basically a math. range from zero to one. With the parameter factor you can change it to zero to factor. With the parameter base you can move the interval. With the last parameter you can defied the interval by zero and move away from zero.

Constructor & Destructor Documentation

DoubleRandomStrategy ( RandGen random,
double  base = 0.0,
double  factor = 1.0,
double  epsilon = 0.0 
)

The constructor.

It becomes the 3 parameters which the class need to generate double value in a special range.

Parameters
random(RandGen*) random generator which create double values in the range zero to one.
base(double) A parameter for the alg. it move a random value.
factor(double) A parameter which resize the interval of the random values.
epsilon(double) A parameter which dified the interval of the random values.
~DoubleRandomStrategy ( )
virtual

default destructor

Member Function Documentation

IValue * getRandomValue ( void  )
virtual

implementation for the interface.

It create the random double value and give it as a IValue back (TemplateValue with type double)

Returns
(IValue*) the random value.

Implements IRandomStrategy.

Member Data Documentation

double m_base
protected

base parameter.

moves the random value interval.

double m_epsilon
protected

epsilon parameter.

dified the random value interval by zero and move it away.

double m_factor
protected

factor parameter.

resize the random value interval.

RandGen* m_random
protected

the random generator


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