functionbinaryVariableGeneration
Binary variables random generator
Extends from Modelica.Icons.Function (Icon for functions).
Information
Function that generates a random binary variable with the input of probability p.
The input p denotes the probability of being true.
Higher p indicates a higher chance of generating true.
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | p | Probaility of 1 | |
| Integer[Modelica.Math.Random.Generators.Xorshift1024star.nState] | stateIn | State of the random number generator |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | y | Random number | |
| Integer[Modelica.Math.Random.Generators.Xorshift1024star.nState] | stateOut | New state of the random number generator |
Revisions
-
December 6, 2024, by Michael Wetter:
Refactored implementation of random number calculations, transfering the local state of the random number generator from one call to the next.
This is for #4069. -
October 3, 2023, by Michael Wetter:
InitializedlocalSeed.
This is for #3549. -
July 20, 2018, by Zhe Wang:
First implementation.