Random Generator Utility Class. More...
Public Member Functions | |
| RandomGenerator (int seed=0) | |
| Default Constructor. More... | |
| ~RandomGenerator () | |
| Destructor. More... | |
| bool | getBool (double trueProbability) |
| return true with probability trueProbability, otherwise false More... | |
| double | getDouble (double min, double max) |
| return a random number within range specified (extreme inclusive) with a Flat distribution More... | |
| double | getGaussian (double var, double mean=0.0) |
| return a random number accordlying to a Gaussian distribution More... | |
| int | getInt (int min, int max) |
| return a random number within range specified (extreme inclusive) with a Flat distribution More... | |
| int | seed () |
| Return the seed setted. More... | |
| void | setSeed (int seed) |
| set the seed of this random number generator More... | |
Detailed Description
Random Generator Utility Class.
- Description
- Create, Manage Random Numbers Generators
- Warnings
Definition at line 44 of file randomgenerator.h.
Constructor & Destructor Documentation
| RandomGenerator | ( | int | seed = 0 | ) |
Default Constructor.
Definition at line 53 of file randomgenerator.cpp.
| ~RandomGenerator | ( | ) |
Destructor.
Definition at line 62 of file randomgenerator.cpp.
Member Function Documentation
| bool getBool | ( | double | trueProbability | ) |
return true with probability trueProbability, otherwise false
Definition at line 79 of file randomgenerator.cpp.
| double getDouble | ( | double | min, |
| double | max | ||
| ) |
return a random number within range specified (extreme inclusive) with a Flat distribution
Definition at line 95 of file randomgenerator.cpp.
| double getGaussian | ( | double | var, |
| double | mean = 0.0 |
||
| ) |
return a random number accordlying to a Gaussian distribution
- Parameters
-
var is the variance of the Gaussian distribution mean is the centre of the Gaussian distribution
Definition at line 104 of file randomgenerator.cpp.
| int getInt | ( | int | min, |
| int | max | ||
| ) |
return a random number within range specified (extreme inclusive) with a Flat distribution
Definition at line 87 of file randomgenerator.cpp.
| int seed | ( | ) |
Return the seed setted.
Definition at line 75 of file randomgenerator.cpp.
Referenced by RandomGenerator::setSeed().
| void setSeed | ( | int | seed | ) |
set the seed of this random number generator
Definition at line 66 of file randomgenerator.cpp.
References RandomGenerator::seed().
The documentation for this class was generated from the following files:
- utilities/include/randomgenerator.h
- utilities/src/randomgenerator.cpp