Random Generator Utility Class. More...

Public Member Functions

 RandomGenerator (int seed=0)
 Default Constructor.
 
 ~RandomGenerator ()
 Destructor.
 
bool getBool (double trueProbability)
 return true with probability trueProbability, otherwise false
 
double getDouble (double min, double max)
 return a random number within range specified (extreme inclusive) with a Flat distribution
 
double getGaussian (double var, double mean=0.0)
 return a random number accordlying to a Gaussian distribution
 
int getInt (int min, int max)
 return a random number within range specified (extreme inclusive) with a Flat distribution
 
int seed ()
 Return the seed setted.
 
void setSeed (int seed)
 set the seed of this random number generator
 

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.

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
varis the variance of the Gaussian distribution
meanis 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: