WOLFRAM SYSTEM MODELER

initialState

Returns an initial state for the xorshift64* algorithm

Wolfram Language

In[1]:=
SystemModel["Modelica.Math.Random.Generators.Xorshift64star.initialState"]
Out[1]:=

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

Syntax

state = Xorshift64star.initialState(localSeed, globalSeed);

Description

Generates the initial state vector state for the Xorshift64star random number generator (= xorshift64* algorithm), from two Integer numbers given as input (arguments localSeed, globalSeed). Any Integer numbers can be given (including zero or negative number). The function returns a reasonable initial state vector with the following strategy:

If both input arguments are zero, a fixed non-zero value is used internally for localSeed. According to xorshift.pdf, the xorshift64* random number generator generates statistically random numbers from a bad seed within one iteration. To be on the safe side, actually 10 random numbers are generated and the returned state is the one from the last iteration.

Example

  parameter Integer localSeed;
  parameter Integer globalSeed;
  Integer state[Xorshift64star.nState];
initial equation
  state = initialState(localSeed, globalSeed);

See also

Random.Generators.Xorshift64star.random.

Syntax

state = initialState(localSeed, globalSeed)

Inputs (2)

localSeed

Type: Integer

Description: The local seed to be used for generating initial states

globalSeed

Type: Integer

Description: The global seed to be combined with the local seed

Outputs (1)

state

Type: Integer[nState]

Description: The generated initial states

Revisions

Date Description
June 22, 2015
DLR logo Initial version implemented by A. Klöckner, F. v.d. Linden, D. Zimmer, M. Otter.
DLR Institute of System Dynamics and Control