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:
binomial
draws from the binomial distribution, and its
argument specifies the distribution's probability;
chi2
draws from the chi2 distribution having
N - 1
degrees of freedom;
normal
draws from the standard normal distribution,
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:
Scenario
object is used to set its d_spread
and
d_nCases
data members;
generator: random
was specified, d_seed
is
initialized with a random seed.
generator: increasing
was specified d_seed
is incremented.
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.