#include <Random.h>
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) |
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] |
Uniform random [0:RAND_MAX]
Referenced by GeneticAlgorithm::InitPopulation(), Int(), GeneticAlgorithm::Mutate(), Real(), and GeneticAlgorithm::Select().
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().