EvolvingObjects
eoUniformGenerator< T > Class Template Reference

The class eoUniform can be used in the STL generate function to easily generate random floats and doubles. More...

#include <eoRndGenerators.h>

Inheritance diagram for eoUniformGenerator< T >:
eoRndGenerator< T > eoF< T > eoFunctorBase

List of all members.

Public Member Functions

 eoUniformGenerator (T _max=T(1.0), eoRng &_rng=rng)
 eoUniformGenerator (T _min, T _max, eoRng &_rng=rng)
operator() (void)
 Generates the number, uses a static_cast to get the right behaviour for ints and unsigneds.
template<>
bool operator() (void)
 The pure virtual function that needs to be implemented by the subclass.

Private Attributes

minim
range
eoRnguniform

Detailed Description

template<class T = double>
class eoUniformGenerator< T >

The class eoUniform can be used in the STL generate function to easily generate random floats and doubles.

It can also be used for ints and unsigneds by virtue of the static_cast in the generator function.

Also present is a specialization for boolean, that will ignore the minima and maxima that are possibly set and will return an unbiased flip of a coin. For a biased flip, use the eoBoolean

either in [0, _max) if only 1 value (_max) is given (or none, as _max defaults to 1.0) or in [_min,_max) if 2 values are given (_min, _max)

Examples:
t-eoEasyPSO.cpp, t-eoExtendedVelocity.cpp, t-eoRandom.cpp, t-eoRingTopology.cpp, t-eoSSGA.cpp, t-eoSyncEasyPSO.cpp, and t-eoVector.cpp.

Definition at line 72 of file eoRndGenerators.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends