functionRandU01
RandU01
Information
RandU01
Uniform random number generation function
Syntax
RandU01(g)
Description
Returns a uniform random number in the interval (0,1), and updates the state of RngStream g by one step
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.RandU01(g);
end for;
end when;
end Example;
// u = {0.988831,0.760616,0.855857,0.546418,0.868702}
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| RngStream | g | RngStream |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | out | Generated uniform random number | |
| RngStream | gout | Updated RngStream |