Common::GaRandomFloat Class Reference

GaRandomFloat class generates random single precision floating-point numbers. Targeted architecture must support IEEE 754 standard. The class implements GaRandom interface. This class has no built-in synchronizator, so LOCK_OBJECT and LOCK_THIS_OBJECT macros cannot be used with instances of this class, but all public methods are thread-safe. More...

#include <D:/Temp/vs/gal/source/Random.h>

Inherits Common::GaRandom< float >.

List of all members.

Public Member Functions

 GaRandomFloat ()
 This constructor initializes random generator with current time as seed.
 GaRandomFloat (unsigned long seed)
 This constructor initialize random generator with user-defined seed.
virtual float GACALL Generate ()
 This method generates random values in interval(0, 1).
virtual float GACALL Generate (const float &max)
 This method generates random values in interval(0, max).
virtual float GACALL Generate (const float &min, const float &max)
 This method generates random values in interval(min, max).

Private Attributes

GaRandomGenerator _generator
 Instance of algorithm for generating random numbers.


Detailed Description

GaRandomFloat class generates random single precision floating-point numbers. Targeted architecture must support IEEE 754 standard. The class implements GaRandom interface. This class has no built-in synchronizator, so LOCK_OBJECT and LOCK_THIS_OBJECT macros cannot be used with instances of this class, but all public methods are thread-safe.


Constructor & Destructor Documentation

Common::GaRandomFloat::GaRandomFloat (  )  [inline]

This constructor initializes random generator with current time as seed.

Common::GaRandomFloat::GaRandomFloat ( unsigned long  seed  )  [inline]

This constructor initialize random generator with user-defined seed.

Parameters:
seed user-defined seed.


Member Function Documentation

virtual float GACALL Common::GaRandomFloat::Generate (  )  [inline, virtual]

This method generates random values in interval(0, 1).

This method is thread-safe.

Returns:
Returns generate random value.

Implements Common::GaRandom< float >.

virtual float GACALL Common::GaRandomFloat::Generate ( const float &  max  )  [inline, virtual]

This method generates random values in interval(0, max).

This method is thread-safe.

Parameters:
max maximal value which can be generated.
Returns:
Returns generate random value.

Implements Common::GaRandom< float >.

virtual float GACALL Common::GaRandomFloat::Generate ( const float &  min,
const float &  max 
) [inline, virtual]

This method generates random values in interval(min, max).

This method is thread-safe.

Parameters:
min minimal value which can be generated.
max maximal value which can be generated.
Returns:
Returns generate random value.

Implements Common::GaRandom< float >.


Member Data Documentation

Instance of algorithm for generating random numbers.


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

Genetic Algorithm Library
Coolsoft Software Development