[Ns-developers] Random Variables API changes
Tom Henderson
tomh at tomh.org
Mon Jan 19 21:34:22 PST 2009
Mathieu Lacage wrote:
> On Sun, 2009-01-18 at 22:34 -0800, Tom Henderson wrote:
>
>> In particular, it would be preferable if the end result of the
>> implementation change were that the seed and run numbers automatically
>> end up in the ConfigStore output for any given execution.
>
> Ok, but that is another issue: would you mind open a bug report to keep
> track of this specific feature ?
Sure.
>
>> 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.
Tom
More information about the Ns-developers
mailing list