[Ns-developers] ***SPAM*** Re: [ns-3] proposed RNG changes [PMX:####]
George Riley
riley at ece.gatech.edu
Wed Sep 10 04:34:53 PDT 2008
Hi Michelle,
See my comments below.
> Hi all,
>
> After discussions with Tom and Mathieu, here are some proposed
> changes to the way the RNG and RandomVariable classes work in ns-3.
> Please feel free to comment.
>
> * no time-based seed initialization
>
> We decided to remove the default behavior of setting the global RNG
> seed by timeofday. Instead, the default will be to have the seed
> set to some constant value. This will result in ns-3 producing the
> same results each time it is run, unless the user changes the global
> seed or changes the run number.
This was discussed at length some time ago (about a year I believe)
and the current implementation was the decision.
I don't think we should be re-visiting ad nauseam prior decisions.
>
>
> The reason for this change is to enforce good simulation practices.
> If the global seed is set by timeofday, the user needs to carefully
> record the exact seed used in order to re-run the same experiment.
> More importantly, if the user plans on running several experiments
> to obtain statistics like an average with confidence intervals,
> using timeofday to set the seed does not guarantee that the multiple
> runs will be independent.
It is easy enough to print out the timeofday seeds on standard out
along with other statistics; I don't see the problem
>
>
> The L'Ecuyer RNG default in ns-3 provides a very easy way to ensure
> that multiple runs are guaranteed to be independent. This is by
> setting a global seed once and changing only the run number for each
> replication of the experiment. The resulting numbers are guaranteed
> to be random and independent.
I agree completely with this. I expect the "good simulation practice"
would be to set a global seed manually, and then change the run number
to get the desired independence and randomness.
>
>
> In addition, with the L'Ecuyer RNG, there is no notion of 'bad'
> seeds or 'good' seeds. Any number used as a seed is valid. The
> range of possible seeds is 1 to MAXINT.
You know much more about this than I do, but there is a subroutine
provided by L'Ecuyer called "CheckSeeds". See the call to it in
random-variable.cc.
I'm not sure I understand why he would provide such a subroutine if
there were indeed no "bad" seeds.
>
>
> The RNG also provides a large stream of random numbers so that for
> each experiment, up to 2^51 (or, 2.3 x 10^15) independent
> replications are possible. This means that the maximum run number
> allowed is 2^51 (or less, depending on the datatype used to store
> the run number).
>
> * change the interface of setting the RNG seed to 1 value instead of
> 6 values
This is fine as long as you don't remove the original one; If I want
to specify the full 6 seed values I should be able to do it. We don'
t need
to "force users" to our way of thinking how this should be done
>
>
> This is just a simplification of the interface. The actual seed in
> the L'Ecuyer RNG is a 6-tuple, which will be set all to the same
> value provided by the user.
>
> * remove the GetSingleValue function from RandomVariable classes
>
> The GetSingleValue function allows for potential non-independence as
> it draws values from a single RNG stream for different random
> variables. Each random variable should have its own RNG stream.
Agree;
>
>
> * provide Stream API
Agree;
George
>
>
> We will provide a Stream API to allow the user to set the seed and
> run number of the global RNG. This Stream API will also allow
> access to the first RNG stream (not associated with any random
> variable) and allow the user to draw numbers from a uniform
> distribution with min and max as parameters.
> Ex: double PickUniform (double min, double max);
> This is different from the random variable Uniform because once the
> RandomVariable object is created, min and max cannot be changed.
>
> -Michele
>
> --
> Michele Weigle
> Assistant Professor
> Department of Computer Science
> Old Dominion University
> Norfolk, VA 23539
> mweigle at cs.odu.edu
> http://www.cs.odu.edu/~mweigle
> (757) 683-6001 ext. 5050
>
>
More information about the Ns-developers
mailing list