Random number library

CMS supports four different pseudo-random number generators (PRNG) that can be specified in the configuration file.

Parameter

Data type

Default

Description

RNG

enum

AESCOUNTER. If the hardware does not support this, falls back to PSEUDODES.

The pseudo-random number generator to use in this simulation. Supported values are:

VANILLA

Based on the .NET Random class.

RANDLIB

Based on the pseudo-random number generator that uses a combination of multiplicative linear congruential generators proposed by Pierre L’Ecuyer 1 and used in numerous scientific computing libraries.

PSEUDODES

Based on the entropy generating step of the Data Encryption Standard published by NIST. The algorithm is psdes described in Numerical Recipes in C.

AESCOUNTER

Similar in concept to PSEUDODES and is based on the entropy generating step of the Advanced Encryption Standard published by NIST in 2001. The implementation uses AES Counter Mode to generate a stream a pseudo-random numbers from the given seed values.

rng_seed

integer

0

The value that seeds the generator and is used with prng_index to determine its initial state.

rng_index

integer

0

The value that indexes the generator. This can be used to identify different runs of an experiment or to seed different instantiations of the compartmental modeling software across multiple processors.

Example

{
    "solver": "SSA",
    "duration": 1000,
    "runs": 3,
    "RNG": { "type": "RANDLIB" },
    "rng_seed" : 2017,
    "rng_index" : 42
}
1

Efficient and Portable Combined Random Number Generators, Communications of the ACM, June 1988