GPLIB++
Public Member Functions | List of all members
gplib::UniformRNG Class Reference

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>

Inheritance diagram for gplib::UniformRNG:
Inheritance graph
[legend]

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 ()
 

Detailed Description

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.

Constructor & Destructor Documentation

gplib::UniformRNG::UniformRNG ( )

Definition at line 10 of file UniformRNG.cpp.

gplib::UniformRNG::~UniformRNG ( )
virtual

Definition at line 17 of file UniformRNG.cpp.

Member Function Documentation

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().

float gplib::UniformRNG::GetNumber ( )
virtual

Returns a random float between 0 and 1.

Implements gplib::GeneralRNG.

Definition at line 27 of file UniformRNG.cpp.

Referenced by GetNumber().

unsigned int gplib::UniformRNG::GetNumber ( const unsigned int  max)
virtual

Return a random integer between 0 and max-1.

Implements gplib::GeneralRNG.

Definition at line 33 of file UniformRNG.cpp.


The documentation for this class was generated from the following files: