Random distributions in PDP++ are handled by an instance of the class
Random. This class has a number of functions which return a random
number from the distribution named by the function. Alternately the
distribution can be specified in the object itself in which case the
Gen()
function returns a value from the specified
distribution. Many of the distributions require parameters which are
again either passed to the specific functions or set on the Random
object itself.
Random class Variables:
Type type
Gen()
function is called. It can have one of the following values:
UNIFORM
var
= half-range
BINOMIAL
var
= p, par
= n
POISSON
var
= lambda
GAMMA
var
and par
= stages
GAUSSIAN
var
NONE
mean
value
float mean
float var
float par
Random Class Functions
float ZeroOne()
float Range(float rng)
float Uniform(float half_rng)
float Binom(int n, float p)
n
trials
each of probability p
float Poisson(float l)
l
float Gamma(float var, int j)
var
and par
number of exponential stages
float Gauss(float var)
var
float Gen()
type
and the
mean
, var
, and par
variables on the Random object
itself.