functionRandInt
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}
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| RngStream | g | ||
| Integer | i | ||
| Integer | j |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | out | ||
| RngStream | gout |