Robot Simulator of the Robotics Group for Self-Organization of Control: DoubleRandomStrategy Class Reference

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages
- Examples

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# DoubleRandomStrategy Class Reference

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

`#include <DoubleRandomStrategy.h>`

Inherits IRandomStrategy.

Inheritance diagram for DoubleRandomStrategy:

[legend]
Collaboration diagram for DoubleRandomStrategy:

[legend]
List of all members.

## 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.

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

- DoubleRandomStrategy.h
- DoubleRandomStrategy.cpp