GPLIB++
|
Generate uniformly distributed random numbers, this is basically a wrapper for the boost random number generators, that is a little easier to use. More...
#include <UniformRNG.h>
Public Member Functions | |
float | GetNumber (const float low, const float high) |
Return a random float between low and high. More... | |
virtual float | GetNumber () |
Returns a random float between 0 and 1. More... | |
virtual unsigned int | GetNumber (const unsigned int max) |
Return a random integer between 0 and max-1. More... | |
UniformRNG () | |
virtual | ~UniformRNG () |
Public Member Functions inherited from gplib::GeneralRNG | |
GeneralRNG () | |
virtual | ~GeneralRNG () |
Generate uniformly distributed random numbers, this is basically a wrapper for the boost random number generators, that is a little easier to use.
During the GA inversion we need a lot of uniformly distributed random numbers, some between 0 and 1, some between a specified minimum and maximum. This class provides a simple and consistent interface to the high quality boost random number generator.
Definition at line 19 of file UniformRNG.h.
gplib::UniformRNG::UniformRNG | ( | ) |
Definition at line 10 of file UniformRNG.cpp.
|
virtual |
Definition at line 17 of file UniformRNG.cpp.
float gplib::UniformRNG::GetNumber | ( | const float | low, |
const float | high | ||
) |
Return a random float between low and high.
Definition at line 21 of file UniformRNG.cpp.
References GetNumber().
Referenced by gplib::NeuralNetwork::InitWeights(), and main().
|
virtual |
Returns a random float between 0 and 1.
Implements gplib::GeneralRNG.
Definition at line 27 of file UniformRNG.cpp.
Referenced by GetNumber().
|
virtual |
Return a random integer between 0 and max-1.
Implements gplib::GeneralRNG.
Definition at line 33 of file UniformRNG.cpp.