Following is a list of mathematical support related commands commonly used in simulation scripts:
$rng seed 0 or n
This command seeds the RNG. If 0 is specified, the RNG is seeded heuristically. Otherwise the RNG is seeded with the value <n>.
This returns the next random number from RNG.
$rng uniform a b
This returns a number uniformly distributed on <a> and <b>.
$rng integer k
This returns an integer uniformly distributed on 0 and k-1.
This returns a number that has exponential distribution with average 1.
set rv [new Randomvariable/type of random-variable]
This creates an instance of a random variable object that generates random variables with specific distribution. The different types of random variables derived from the base class are:
RandomVariable/Uniform, RandomVariable/Exponential, RandomVariable/Pareto, RandomVariable/Constant, RandomVariable/HyperExponential. Each of these distribution types are parameterized with values of appropriate parameters. For details see section 20.2 of this chapter.
$rv use-rng rng
This method is used to associated a random variable object with a non-default RNG. Otherwise by default, the random variable object is associated with the default random number generator.