25.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 $n == 0$, 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 $avg$ $std$
- return a number sampled from a normal distribution with the given average and standard deviation
lognormal $avg$ $std$
- 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 $mu$
- return a number sampled from an exponential distribution with mean $mu$
uniform $min$ $max$
- return an integer sampled from a uniform distribution on [$min$, $max$]
integer $k$
- return an integer sampled from a uniform distribution on [0, $k$-1]

Tom Henderson 2011-11-05