#include <DoubleRandomStrategy.h>
Inherits IRandomStrategy.
Inheritance diagram for DoubleRandomStrategy:
Public Member Functions | |
DoubleRandomStrategy (RandGen *random, double base=0.0, double factor=1.0, double epsilon=0.0) | |
The constructor. | |
virtual | ~DoubleRandomStrategy () |
default destructor | |
virtual IValue * | getRandomValue (void) |
implementation for the interface. | |
Protected Attributes | |
RandGen * | m_random |
the random generator | |
double | m_base |
base parameter. | |
double | m_factor |
factor parameter. | |
double | m_epsilon |
epsilon parameter. |
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.
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.
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
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)
Implements IRandomStrategy.
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.