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
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.SIunits.Time | instance (from InputOutput) | The current time for an arithmetic random number generator | |
| Integer | states_in (from InputOutput) | The discrete states for a recursive random number generator | |
| Integer | a | 69069 | The multiplier for the linear congruential generator |
| Integer | c | 1 | The increment for the linear congruential generator |
| Integer | m | 2147483647 | The modulus for the linear congruential generator |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | rand (from InputOutput) | The random number with a uniform distribution on the interval [1,0] | |
| Integer | states_out (from InputOutput) | The new states of a recursive random number generator |
Revisions
Developed 2014 at the DLR Institute of System Dynamics and Control