.Modelica.Math.Random.Utilities.automaticLocalSeed

Information

Syntax

seed = Utilities.automaticLocalSeed(path);

Description

Returns an automatically computed seed (Integer) from the hash value of the full path name of an instance (has to be inquired in the model or block where this function is called by the Modelica built-in operator getInstanceName()). Contrary to automaticGlobalSeed(), this is a pure function, that is, the same seed is returned, if an identical path is provided.

Example

parameter Boolean useAutomaticLocalSeed = true;
parameter Integer fixedLocalSeed        = 10;
final parameter Integer localSeed = if useAutomaticLocalSeed then
                                   automaticLocalSeed(getInstanceName())
                                 else
                                   fixedLocalSeed;

See also

automaticGlobalSeed, hashString and getInstanceName.

Interface

function automaticLocalSeed
  extends Modelica.Icons.Function;
  input String path "Full path name of the instance (inquire with getInstanceName())";
  output Integer seed "Automatically generated seed";
end automaticLocalSeed;

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

Generated at 2024-05-16T18:15:58Z by OpenModelicaOpenModelica 1.22.4 using GenerateDoc.mos