22.1.2.1 Commands

The following commands on the RNG class can be accessed from OTcl and are found in tools/rng.cc:

seed $n$
- seed the RNG to $n$, if , the seed is set according to the current time and a counter
next-random
- return the next random number
seed
- return the current value of the seed
next-substream
- advance to the next substream
reset-start-substream
- reset the stream to the beginning of the current substream
normal
- return a number sampled from a normal distribution with the given average and standard deviation
lognormal
- return a number sampled from a lognormal distribution with the given average and standard deviation

The following commands on the RNG class can be accessed from OTcl and are found in tcl/lib/ns-random.tcl:

exponential
- return a number sampled from an exponential distribution with mean
uniform
- return an integer sampled from a uniform distribution on [, ]
integer
- return an integer sampled from a uniform distribution on [0, -1]

Paul Kroon 2008-03-16