.DESLib.RandomLib.CMRG.SetSeed

Information

SetSeed

Syntax

SetSeed(g,seed)

Description

Changes the initial seed of the RngStream g. This modificatioin also changes the current state of the RngStream.

Examples

  g2 := g1;
  for i in 1:3 loop
    (u1[i],g1) := CMRG.RandU01(g1);
    (u2[i],g2) := CMRG.RandU01(g2);
  end for;
  g2 := CMRG.SetSeed(g2,{2345,2435,2345,2345,2345,2345});
  for i in 4:6 loop
    (u1[i],g1) := CMRG.RandU01(g1);
    (u2[i],g2) := CMRG.RandU01(g2);
  end for;

  // u1 = {0.586819,0.848015,0.494309,0.609745,0.698027,0.812434}
  // u2 = {0.586819,0.848015,0.494309,0.813362,0.517802,0.947542}

Interface

function SetSeed
  input RngStream g "RngStream";
  input Src.Seed seed "New seed";
  output RngStream gout "Updated RngStream";
  output Integer out "result (0 == success)";
end SetSeed;

Generated at 2024-11-21T19:25:40Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos