automaticLocalSeed

Creates an automatic local seed from the instance name

Information

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

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.

Syntax

seed = automaticLocalSeed(path)

Inputs (1)

path

Type: String

Description: Full path name of the instance (inquire with getInstanceName())

Outputs (1)

seed

Type: Integer

Description: Automatically generated seed