#include <Random.h>
Public Member Functions | |
virtual | ~Random () |
Destructor. | |
Static Public Member Functions | |
static long int | value () |
Generate a pseudo-random value. | |
static void | destroy () |
Destroy the instance of Random. | |
static long int | getMaxVal () |
Accessor to the max value Random can generated. | |
static long int | getMinVal () |
Accessor to the min value Random can generated. | |
Protected Member Functions | |
Random () | |
Constructor. | |
Static Protected Attributes | |
static Random * | _instance = NULL |
Definition at line 31 of file Random.h.
long int Random::value | ( | ) | [static] |
Generate a pseudo-random value.
Definition at line 36 of file Random.cpp.
References _instance, and Random().
Referenced by GeneticReplication::createWorshiper(), GeneticCode::crossover(), GeneticCode::GeneticCode(), HeuristicReplication::getNewWorshipers(), GeneticReplication::getNewWorshipers(), GeneticCode::mutate(), Behaviour::randomMove(), UntilVictoryFight::resolve(), and World::World().
00036 { 00037 if(_instance == NULL) { 00038 _instance = new Random(); 00039 } 00040 00041 return rand(); 00042 }
long int Random::getMaxVal | ( | ) | [static] |
Accessor to the max value Random can generated.
Definition at line 51 of file Random.cpp.
long int Random::getMinVal | ( | ) | [static] |
Accessor to the min value Random can generated.
Definition at line 55 of file Random.cpp.
Random * Random::_instance = NULL [static, protected] |