RndUniF Random Type (for wait statements)

Action

Declares a random variable of type RndUniF. With each access, such a variable contains a value that is generated following a uniform distribution. The parameters of the RndUniF function specify the minimum value and the maximum value of the uniform distribution. Random variables of type RndUniF can be used solely in wait statements for generating random user times.

Syntax

RndUniF( l..u ): float;

Return value

float

Parameter Description
l Lower boundary (float)
u

Upper boundary (float)

Condition: l <= u

Example

dclrand
  rEvent1, rEvent2 : RndBin(0.25);
  rTime1           : RndExpF(5.5);
  rTime2           : RndUniF(0.5..12.5);

dcltrans
  transaction t1
  begin
    if rEvent1 then ... end;
    wait rTime2;
    while not rEvent2 do ... end;
  end t1;

The example shows a random variable with uniform distribution (rTime2). The lower boundary of this random variable is 0.5 and the upper boundary is 12.5. In the interval 0.5 to 12.5 all floating-point values have the same probability. rTime2 is used in a wait statement of a transaction for simulating a random waiting period.

Sample scripts

RandomLogin.bdf, Measure01.bdf, Measure03.bdf, DBApi01.bdf