RndUniI Random Type (uniform distribution with intervals)

Action

Declares a random variable of type RndUniI. With each access, such a variable contains a value that is generated following a uniform distribution with intervals. With a random variable of type RndUniI you can define multiple intervals of random integer values.

Syntax

RndUniI( l1..u1=p1, ..., ln..un=pn ): number;

Return value

number

Parameter Description
l1 Lower boundary of the first interval of random values (number)
u1 Upper boundary of the first interval of random values (number)
p1 Probability of choosing the first interval of values (float)
ln Lower boundary of the nth interval of random values (number)
un Upper boundary of the nth interval of random values (number)
pn

Probability of choosing the nth interval of values (float)

Condition: pi = 1; i : li <= ui

Example

dclrand
  rEvent1, rEvent2 : RndBin(0.25);
  rTime1           : RndExpF(5.5);
  rTime2           : RndUniF(0.5..12.5);
  rCube            : RndUniN(1..6);
  rPrice           : RndUniN(10..2000);
  rArtNo           : RndUniI(1..50=0.6, 51..100=0.3, 101..10000=0.1);

dclsql
  UpdArticle:
    UPDATE article SET price = :rPrice
    WHERE articlenumber = :rArtNo;

The random variable rArtNo is used in a SQL command to access an article with a random article number. 60% of all integer random values are between 1 and 50, 30% are between 51 and 100 and 10% are between 101 and 10000.

Sample scripts

OraSample.bdf, DBApi01.bdf, Trans.bdf