[Ns-developers] Random Variables API changes

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Mon Jan 19 23:49:06 PST 2009


On Mon, 2009-01-19 at 21:34 -0800, Tom Henderson wrote:

> >> Similarly, in all of the example files, I think we should be careful to 
> >> update our suggested usage pattern; e.g.:
> >>
> >> -  RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
> >> +  uint32_t seed[6] = {1, 1, 2, 3, 5, 8};
> >> +  SeedManager::SetSeed(seed);
> >>
> >> is going to reinforce the less-preferred behavior of changing seeds each 
> >> time to try to get independent runs.  Better would be something like:
> >>
> >> -  RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
> >> +  // Change either the run number below or the RngXXX attribute to 
> >> obtain an independent replication
> >> +  SeedManager::SetRun (1);
> > 
> > I was under the impression that the recommended usage would be more
> > along the lines of:
> > 
> > - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
> > 
> > and recommend using either the command-line or the env variable to
> > change the global seed and/or the run number.
> > 
> 
>  From what I understand, there is not really any advantage to specifying 
> a six-tuple seed rather than a single integer.  Also, the recommended 
> way to get independent replications is to set the run number differently 
> using the same seed-- that is one of the main reasons we are abandoning 
> time of day or /dev/random as a global seed.  So, it may be better if we 
> deemphasize setting seeds in the example scripts and instead set run 
> numbers.

I understand all this and I agree with it. I wanted to point out that I
thought that the recommended default was to set the run number using
NS_RNG or command line arguments rather than a hardcoded run number in
the script.

Mathieu




More information about the Ns-developers mailing list