Chapter 4: Generating Random Numbers

4.1: Random

Objects of the class Random generate random numbers. Mercenne twisters (defined in C++'s STL as the std::mt19937 type) generate random values. Its public members returning random values are: Each of these member returns random values drawn from the corresponding statistical distribution. Each distribution uses its own mercenne twister to obtain its next random value.

The members uniform, uniformCase return random values drawn from the uniform random distribution. and logNormal from the standard log-normal distribution. The other members are only used and are only available when spread: true is specified. In that case at least N = 2 cases must be simulated as the chi2 distribution uses N - 1 degrees of freedom. If spread: true is specified the following members are available and are used for random variations of various configured parameters:

At each new analysis Scenario's seed value is assigned to the Random object's seed value. Then, at each Loop iteration the Random object is re-initialized:

Next the generators and distributions are reset by the member reset.

The member reset resets the mercenne twisters by assigning new mt19937 objects, initialized with d_seed. Next the various distributions are reset.