Random Functions

Random results are cached per call site for the current simulation time. Re-evaluating the same equation during one integration step does not draw again; advancing simulation time does.

sample controls how long a draw is retained. Omit it or use NAN to draw at every DT. A finite value is converted to floor(sample / DT) integration steps (at least one), so sample = 1 changes at start time, start time + 1, start time + 2, and so on when the time unit is one. INF retains the initial draw for the entire simulation. LOOKUPRANDOM has a variable number of values; append NAN, sample after its values, for example LOOKUPRANDOM(10, 20, 30, NAN, 1).

Continuous distributions

FunctionResult and edge semanticsExample
BETA(alpha, beta, [min, max, seed, sample])Beta-distributed value formed from two gamma draws, optionally clamped to output bounds. Invalid nonpositive shapes use the gamma sampler safeguards.BETA(2, 5, 0.1, 0.9, NAN, NAN)
EXPRND(mean, [min, max, seed, sample])Exponential draw, optionally clamped to output bounds; mean is clamped to at least 0.EXPRND(5, 0, 10, NAN, NAN)
GAMMA(shape, scale, [min, max, seed, sample])Gamma draw, optionally clamped to output bounds. Nonpositive shape or scale returns 0 before bounds are applied.GAMMA(2, 3, 0, 20, NAN, NAN)
LOGISTIC(mean, scale, [min, max, seed, sample])Logistic draw mean + scale * log(u / (1-u)), optionally clamped to output bounds. Scale is used as supplied, including negative values.LOGISTIC(10, 2, 0, 20, NAN, NAN)
LOGNORMAL(mu, sigma, [min, max, seed, sample])EXP(NORMAL(mu, sigma)), optionally clamped to output bounds; a nonpositive sigma makes the underlying normal draw equal to mu.LOGNORMAL(0, 0.5, 0.1, 5, NAN, NAN)
NORMAL(mean, stddev, [min, max, seed, sample])Normal draw, optionally clamped to output bounds. A nonpositive standard deviation returns mean before bounds are applied.NORMAL(100, 15, 0, 200, NAN, NAN)
UNIFORM(min, max, [seed, sample])Uniform draw over the inclusive numeric range. Reversed bounds are reordered; equal bounds return that value.UNIFORM(0, 1, NAN, 1)

Discrete and selection distributions

The count-valued functions keep their integer or categorical result domains and do not accept an extra output-bound pair. UNIFORM already takes its output minimum and maximum as required arguments.

FunctionResult and edge semanticsExample
BINOMIAL(trials, probability, [seed, sample])Number of successes. trials is rounded and clamped to at least 0; probability is clamped to [0, 1].BINOMIAL(20, 0.3, NAN, 1)
GEOMETRIC(probability, [seed, sample])Number of trials through the first success. Probability is clamped away from 0; probability 1 returns 1.GEOMETRIC(0.25, NAN, 1)
LOOKUPRANDOM(a, b, c, ..., [NAN, sample])Uniformly chooses one supplied argument. Requires at least one.LOOKUPRANDOM(10, 20, 30, NAN, 1)
MONTECARLO(probability, [seed, sample])Bernoulli result 1 or 0; probability is clamped to [0, 1].MONTECARLO(0.1, NAN, 1)
NEGBINOMIAL(successes, probability, [seed, sample])Failures observed before the requested successes. Successes are rounded and clamped to at least 0; probability is clamped by the sampler.NEGBINOMIAL(4, 0.5, NAN, 1)
POISSON(mean, [seed, sample])Poisson count. Nonpositive mean returns 0.POISSON(8, NAN, 1)

Yano Simulator Help — Version 0.3.0, Build 20260929