functionRNG_LCG

Linear congruential generator implementing the equation i = mod(a*i+c, m)

Extends from Noise.Utilities.Interfaces.SampleBasedRNG (The interface for sample based random number generators).

Inputs

TypeNameDefaultDescription
Modelica.SIunits.Timeinstance (from InputOutput)The current time for an arithmetic random number generator
Integerstates_in (from InputOutput)The discrete states for a recursive random number generator
Integera69069The multiplier for the linear congruential generator
Integerc1The increment for the linear congruential generator
Integerm2147483647The modulus for the linear congruential generator

Outputs

TypeNameDefaultDescription
Realrand (from InputOutput)The random number with a uniform distribution on the interval [1,0]
Integerstates_out (from InputOutput)The new states of a recursive random number generator

Revisions

Developed 2014 at the DLR Institute of System Dynamics and Control