RTP Trace System
1.0
|
#include <randomizer.h>
Public Member Functions | |
Randomizer () | |
void | setSeed () |
void | setSeed (const cardinal seed) |
card8 | random8 () |
card16 | random16 () |
card32 | random32 () |
card64 | random64 () |
double | random () |
cardinal | random (const cardinal a, const cardinal b) |
double | random (const double a, const double b) |
Private Attributes | |
card32 | Value |
This class is an randomizer. The randomizer algorithm will calculate random numbers with seed given by system timer (microseconds since January 01, 1970) or given by a number.
Constructor. Seed will be initialized by system timer (microseconds since January 01, 1970).
double Coral::Randomizer::random | ( | ) | [inline] |
Get double random number out of interval [0,1].
cardinal Coral::Randomizer::random | ( | const cardinal | a, |
const cardinal | b | ||
) |
Get double random cardinal number out of interval [a,b].
double Coral::Randomizer::random | ( | const double | a, |
const double | b | ||
) |
Get double random double number out of interval [a,b].
card16 Coral::Randomizer::random16 | ( | ) | [inline] |
Get 16-bit random number.
card32 Coral::Randomizer::random32 | ( | ) | [inline] |
Get 32-bit random number.
card64 Coral::Randomizer::random64 | ( | ) | [inline] |
Get 64-bit random number.
card8 Coral::Randomizer::random8 | ( | ) | [inline] |
Get 8-bit random number.
void Coral::Randomizer::setSeed | ( | ) |
Set seed by system timer (microseconds since January 01, 1970).
void Coral::Randomizer::setSeed | ( | const cardinal | seed | ) |
Set seed by given number.
seed | Seed value. |
card32 Coral::Randomizer::Value [private] |