[Ns-developers] Random Variables API changes

Michele Weigle mweigle at csnet.cs.odu.edu
Tue Jan 20 10:13:47 PST 2009


On Jan 19, 2009, at 3:31 PM, Mathieu Lacage wrote:
> On Sun, 2009-01-18 at 12:57 +0100, Mathieu Lacage wrote:
>
>> I wonder why you don't just forward all the SeedManager::Set/Get  
>> method
>> calls to the RngStream class rather than keep track of your own  
>> global
>> see: it would save you from having to keep your own set of static  
>> global
>> seeds (the same variables are stored in RngStream), you could move
>> the ::Initialize code below to RngStream::RngStream and remove the  
>> call
>> to ::Initialize from all the GetValue methods.
>
> I implemented the necessary bits in RngStream for the above (in  
> attached
> patch). The only missing piece is modifying the RandomVariable code
> which I could do if you want me to.
>
>> 4) From an implementation perspective, I think that you are missing  
>> the
>> NS_RNG env variable handling and the various --Rng* command line  
>> options
>> I suggested in:
>> http://mailman.isi.edu/pipermail/ns-developers/2008-November/004907.html
>
> as well as the code necessary for the above. There is a big XXX  
> which I
> don't know how to fix: I assume that michele will know what to do  
> which
> is why I CCed her.

Yes, we just need to add one line in EnsureGlobalInitialized() to set  
things to the correct substream:

    SetPackageSeed (seedArray);
+  // set to the chosen substream (run)
+  ResetNthSubstream (run);
  }

-Michele




More information about the Ns-developers mailing list