25.4 ns-random

ns-random is an obsolete way to generate random numbers. This information is provided only for backward compatibility.

ns-random is implemented in ~ns/misc.{cc,h}. When called with no argument, it generates a random number with uniform distribution between 0 and MAXINT. When an integer argument is provided, it seeds the random generater with the given number. A special case is when ns-random 0 is called, it randomly seeds the generator based on current time. This feature is useful to produce non-deterministic results across runs.



Tom Henderson 2011-11-05