[Ns-developers] Random Variables API changes

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Thu Jan 22 02:43:25 PST 2009


On Wed, 2009-01-21 at 14:32 -0500, Raj Bhattacharjea 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.
> >
> 
> Could you provide a patch to do what you propose?

rng.patch: cleanup coding style in random-variable.cc, update API. I did
not change the lazy creation of m_generator but, as I mentionned in a
previous email, I did not find any rationale for this so, my gut feeling
would be to revert to non-lazy creation of these.

examples.patch: remove all calls to SetSeed

get-single-value.patch: update users of GetSingleValue to do something
slightly more sensible than just creation temporary UniformVariables all
the time. I did not update OlsrAgentImpl.

What is missing:
1) Must update all reference traces now.
2) optionally, change the --regression code to set NS_RNG:1:1 before
running any test (not really needed because it is the default)
3) I did not do any of the extensions we discussed: integration in
ConfigStore and per-variable seed/run changes

I would support merging these in ns-3-dev as-is.

thanks,
Mathieu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: examples.patch
Type: text/x-patch
Size: 13550 bytes
Desc: not available
Url : http://mailman.isi.edu/pipermail/ns-developers/attachments/20090122/e2675753/examples-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get-single-value.patch
Type: text/x-patch
Size: 3500 bytes
Desc: not available
Url : http://mailman.isi.edu/pipermail/ns-developers/attachments/20090122/e2675753/get-single-value-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rng.patch
Type: text/x-patch
Size: 20965 bytes
Desc: not available
Url : http://mailman.isi.edu/pipermail/ns-developers/attachments/20090122/e2675753/rng-0001.bin


More information about the Ns-developers mailing list