functioninitialStateWithXorshift64star
Return an initial state vector for a random number generator (based on xorshift64star algorithm)
Extends from Modelica.Icons.Function (Icon for functions).
Information
Syntax
state = Utilities.initialStateWithXorshift6star(localSeed, globalSeed, nState);
Description
The Xorshift64star random number generator is used to fill a state vector of length nState (nState ≥ 1) with random numbers and return this vector. Arguments localSeed and globalSeed are any Integer numbers (including zero or negative number) that characterize the initial state. If the same localSeed, globalSeed, nState is given, the same state vector is returned.
Example
parameter Integer localSeed; parameter Integer globalSeed; Integer state[33]; initial equation state = Utilities.initialStateWithXorshift64star(localSeed, globalSeed, size(state,1));
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | localSeed | The local seed to be used for generating initial states | |
| Integer | globalSeed | The global seed to be combined with the local seed | |
| Integer | nState | The dimension of the state vector (>= 1) |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | state | The generated initial states |
Revisions
| Date | Description | ||
|---|---|---|---|
| June 22, 2015 |
|