Skip to content

Random draws

Each call draws from the stream of the block (or agent) that evaluates it.

Each value is the expression evaluated on its own; a random call draws from a stream seeded 0.

DISC

DISC(value1, prob1, value2, prob2, ...): 2 or more arguments.

value/prob pairs (>= 1 pair), probs must sum to 1.

Example: DISC(1, 0.5, 2, 0.3, 3, 0.2) gives 3.

Used in the bundled models Container terminal: electrification, Container terminal: quay to yard, Priority jobs with rework, Walk-in clinic (library assets).

EXPO

EXPO(mean): 1 argument.

exponential(mean), sampled from the calling block's own rng.

Example: EXPO(2) gives 1.36.

Used in the bundled models Machine agent with repair, Server busy/idle cycle (agents), SIR epidemic (agents), Biogas plant (library assets) and 8 more.

NORM

NORM(mean, sd): 2 arguments.

normal(mean, sd), sampled from the calling block's own rng.

Example: NORM(10, 2) gives 9.736.

Used in the bundled models Boids flock (continuous, heading).

RAND

RAND(): no arguments.

uniform [0, 1), sampled from the calling block's own rng.

Example: RAND() gives 0.8133.

Used in the bundled models Container terminal: electrification, Container terminal: quay to yard, Make-to-order line (library assets), Priority jobs with rework and 1 more.

TRIA

TRIA(low, mode, high): 3 arguments.

triangular(low, mode, high), sampled from the calling block's own rng.

Example: TRIA(1, 2, 6) gives 1.453.

Used in the bundled models Biogas plant (library assets), Container terminal: electrification, Container terminal: quay to yard, Order-driven warehouse (library assets) and 6 more.

UNIF

UNIF(low, high): 2 arguments.

uniform(low, high), sampled from the calling block's own rng.

Example: UNIF(0, 10) gives 0.1653.

Used in the bundled models Boids flock (continuous, heading), Nagel-Schreckenberg traffic (ring), Sugarscape with regrowth (grid, patches), Wolf-Sheep predation with grass (grid) and 2 more.

See also