Random Class Reference

#include <Random.h>

List of all members.

Static Public Member Functions

static unsigned long Seed (unsigned long seed=0L)
static unsigned long Int ()
static long Int (long a, long b)
static double Real (double a=0.0, double b=1.0)
static long NonUniformInt (double weight, long a, long b)
static double NonUniformReal (double weight, double a=0.0, double b=1.0)
static bool Probability (double p)


Detailed Description

Simple random number generator (based on standard rand() function).

Member Function Documentation

static unsigned long Random::Seed ( unsigned long  seed = 0L  )  [inline, static]

Sets the random seed. (0 = "random")

Referenced by GeneticAlgorithm::GeneticAlgorithm().

static unsigned long Random::Int (  )  [inline, static]

static long Random::Int ( long  a,
long  b 
) [inline, static]

Uniform random (integer) [a:b]

References Int().

static double Random::Real ( double  a = 0.0,
double  b = 1.0 
) [inline, static]

Uniform random (real) [a:b]

References Int().

Referenced by NonUniformInt(), NonUniformReal(), and Probability().

static long Random::NonUniformInt ( double  weight,
long  a,
long  b 
) [inline, static]

Non-uniform. Integer version [a,b)

References Real().

static double Random::NonUniformReal ( double  weight,
double  a = 0.0,
double  b = 1.0 
) [inline, static]

Non-uniform. Float version

References Real().

static bool Random::Probability ( double  p  )  [inline, static]

Probability ("flip coin"): [0% = 0.0 and 100% = 1.0]

References Real().

Referenced by GeneticAlgorithm::Generation().


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