.DESLib.RandomLib.CMRG.RandInt

Information

RandInt

Discrete distribution random number generation function

Syntax

RandInt(g,i,j)

Description

Returns a rundom number from the discrete uniform distribution over the integer (i,i+1,...,j), using RngStream g

Examples

model Example
  CMRG.RngStream g;
  Real u[5];
algorithm
  when initial() then
    g := CMRG.CreateStream();
  end when;
  when time <= 0 then
    for i in 1:5 loop
      (u[i],g) := CMRG.RandInt(g);
    end for;
  end when;
end Example;

// u = {8,8,7,9,2}

Interface

function RandInt
  input RngStream g;
  input Integer i;
  input Integer j;
  output Integer out;
  output RngStream gout;
end RandInt;

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