From GridLAB-D Wiki
Jump to: navigation, search

RUN - Global variable to get a unique run identifier




The RUN global variable dynamically generates a unique 128-bit identifier that is generated the first time it is referenced. This can be used to generate object names, file names, and database entities that are unique for a single run.


The following code defines a class test with a random variable x. The name of the object is unique and shared in the current run.

class test {
  random x;
object test {
  name test-${RUN};
  x "type:normal(0,1); refresh:1min";


The random number generated is seeded using the current system time with a resolution of 1 second. Consequently, if two runs are started within the same second they are very likely to generate the same sequence of unique ids.


The unique run id was introduced in Hassayampa (Version 3.0).

See also