[Ns-developers] ns3: random numbers
Mathieu.Lacage at sophia.inria.fr
Mon Mar 12 09:06:04 PDT 2007
On Thu, 2007-03-08 at 13:51 -0500, Michele Weigle wrote:
> It's fine to set the package seed (SetPackageSeed), but I don't
> think that we should use SetSeed(). (L'Ecuyer even mentions in the
> paper that's the source of this code that SetSeed() shouldn't really
> be used.) We really only want to allow the user to set the package
> seed once for the entire simulation before any other RNGStreams are
> created. The power of L'Ecuyer's implementation is that once you set
> the seed at the beginning, all newly created RNG streams are
> guaranteed to be independent, without having to set the seed
> manually. So, maybe in this meta-class, there's a SetSeed()
> function, but it shouldn't be accessible for individual RNGStreams,
> and it should be usable only if there currently exists just a single
> RNGStream object.
I think that you are suggesting here removing entirely the
RandomVariable::SetSeed method to not allow the user to reseed a stream
once it has been created. Am I right ? If so, I concur.
If I understood you well, what you describe is a system where once you
have seeded the "main seeding stream" (what, I think, you call the
meta-class), you should never reseed until you have finished the
simulation. Am I right ?
> I'm torn between having the default seed be picked by time of day
> or just using a constant seed. I understand that the constant seed
> can be confusing if you're expecting a different result each time you
> run the simulation, but it's important that the user realize that the
> data from those runs (that use time of day as the seed) may not be
> independent. The only way to guarantee independence between
> simulation runs is to use the substream mechanism.
As an end-user, I do not really understand the concept of substream but
I certainly would favor using a constant seed by default to ensure that
two runs of the same code generate the same results, by default.
More information about the Ns-developers