1.1 Quick Overview
ns-3 random numbers are provided via instances of class RandomVariable
.
- by default, ns-3 simulations use a fixed seed; if there is any
randomness in the simulation, each run of the program will yield identical
results uniess the seed and/or run number is changed.
- in ns-3.3 and earlier, ns-3 simulations used a random seed by
default; this marks a change in policy starting with ns-3.4
- to obtain randomness across multiple simulation runs, you must either
set the seed differently or set the run number differently. To set a seed, call
SeedManager::SetSeed(uint32_t)
at the beginning of the program;
to set a run number with the same seed, call
SeedManager::SetRun (uint32_t)
at the beginning of the program;
See section Seeding and independent replications
- each RandomVariable used in ns-3 has a virtual random number
generator associated with it; all random variables use either a fixed
or random seed based on the use of the global seed (previous bullet);
- if you intend to perform multiple runs of the same scenario, with
different random numbers, please be sure to read the section on how to
perform independent replications: See section Seeding and independent replications.
Read further for more explanation about the random number facility for
ns-3.
This document was generated on April, 2 2009 using texi2html 1.78.