iLand
Public Types | Public Member Functions | Static Public Member Functions | List of all members
RandomGenerator Class Reference

#include <randomgenerator.h>

Public Types

enum  ERandomGenerators { ergMersenneTwister , ergWellRNG512 , ergXORShift96 , ergFastRandom }
 

Public Member Functions

 RandomGenerator ()
 

Static Public Member Functions

static void setGeneratorType (const ERandomGenerators gen)
 set the type of the random generator that should be used. More...
 
static void debugState (int &rIndex, int &rGeneration, int &rRefillCount)
 
static int debugNRandomNumbers ()
 
static void checkGenerator ()
 call this function to check if we need to create new random numbers. More...
 
static void setup (const ERandomGenerators gen, const unsigned oneSeed)
 
static void seed (const unsigned oneSeed)
 set a random generator seed. If oneSeed is 0, then a random number (provided by system time) is used as initial seed. More...
 
static double rand ()
 get a random value from [0., 1.] More...
 
static double rand (const double max_value)
 
static unsigned long randInt ()
 get a random integer in [0,2^32-1] More...
 
static unsigned long randInt (const int max_value)
 
static double randNorm (const double mean, const double stddev)
 Access to nonuniform random number distributions. More...
 

Member Enumeration Documentation

◆ ERandomGenerators

Enumerator
ergMersenneTwister 
ergWellRNG512 
ergXORShift96 
ergFastRandom 

Constructor & Destructor Documentation

◆ RandomGenerator()

RandomGenerator::RandomGenerator ( )
inline

Member Function Documentation

◆ checkGenerator()

static void RandomGenerator::checkGenerator ( )
inlinestatic

call this function to check if we need to create new random numbers.

this function is not reentrant! (e.g. call every year in the model)

◆ debugNRandomNumbers()

static int RandomGenerator::debugNRandomNumbers ( )
inlinestatic

◆ debugState()

static void RandomGenerator::debugState ( int &  rIndex,
int &  rGeneration,
int &  rRefillCount 
)
inlinestatic

◆ rand() [1/2]

static double RandomGenerator::rand ( )
inlinestatic

get a random value from [0., 1.]

◆ rand() [2/2]

static double RandomGenerator::rand ( const double  max_value)
inlinestatic

◆ randInt() [1/2]

static unsigned long RandomGenerator::randInt ( )
inlinestatic

get a random integer in [0,2^32-1]

◆ randInt() [2/2]

static unsigned long RandomGenerator::randInt ( const int  max_value)
inlinestatic

◆ randNorm()

double RandomGenerator::randNorm ( const double  mean,
const double  stddev 
)
inlinestatic

Access to nonuniform random number distributions.

◆ seed()

void RandomGenerator::seed ( const unsigned  oneSeed)
static

set a random generator seed. If oneSeed is 0, then a random number (provided by system time) is used as initial seed.

◆ setGeneratorType()

static void RandomGenerator::setGeneratorType ( const ERandomGenerators  gen)
inlinestatic

set the type of the random generator that should be used.

◆ setup()

static void RandomGenerator::setup ( const ERandomGenerators  gen,
const unsigned  oneSeed 
)
inlinestatic

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