[Ns-developers] ns-3.4 : Random Variables
Raj Bhattacharjea
raj.b at gatech.edu
Wed Feb 25 09:32:51 PST 2009
On Wed, Feb 25, 2009 at 5:21 AM, Mathieu Lacage
<mathieu.lacage at sophia.inria.fr> wrote:
> I fixed a small build error and removed the dead SeedManager::CheckSeed
Thanks for these cleanups; I could have sworn I had the build issue
fixed when I ran the test suite (because it passed).
> (uint32_t[6]) function. The attached patch removes the env var support
> from rng-stream.cc (-87 LOCs) to use the one in global-value.cc. I
> tested it with:
>
I didn't know GlobalValue had support for this sort of thing; we
probably should have been using this facility from the beginning
rather than duplicating code rng-stream.cc :
EnsureGlobalInitialized().
> NS_GLOBAL_VALUE='RngSeed=1;RngRun=1' ./waf --regression
> NS_GLOBAL_VALUE='RngSeed=1;RngRun=2' ./waf --regression
> NS_GLOBAL_VALUE='RngSeed=2;RngRun=1' ./waf --regression
> NS_GLOBAL_VALUE='RngSeed=2;RngRun=2' ./waf --regression
>
> and:
> [mlacage at diese ns-3-dev]$ NS_GLOBAL_VALUE='RngSeed=3;RngRun=2' ./build/optimized/examples/csma-raw-ip-socket --RngSeed=2 --RngRun=3
> seed=2, run=3
> [mlacage at diese ns-3-dev]$ NS_GLOBAL_VALUE='RngSeed=3;RngRun=2' ./build/optimized/examples/csma-raw-ip-socket --RngSeed=2
> seed=2, run=2
> [mlacage at diese ns-3-dev]$ NS_GLOBAL_VALUE='RngSeed=3;RngRun=2' ./build/optimized/examples/csma-raw-ip-socket
> seed=3, run=2
> [mlacage at diese ns-3-dev]$
>
> with this patch:
>
> [mlacage at diese ns-3-dev]$ hg diff examples/csma-raw-ip-socket.cc
> diff -r c35796bc0b4b examples/csma-raw-ip-socket.cc
> --- a/examples/csma-raw-ip-socket.cc Wed Feb 25 11:00:50 2009 +0100
> +++ b/examples/csma-raw-ip-socket.cc Wed Feb 25 11:15:07 2009 +0100
> @@ -57,6 +57,10 @@
> CommandLine cmd;
> cmd.Parse (argc, argv);
>
> + std::cout << "seed=" << SeedManager::GetSeed ()
> + << ", run=" << SeedManager::GetRun () << std::endl;
> +
> +
> // Here, we will explicitly create four nodes.
> NS_LOG_INFO ("Create nodes.");
> NodeContainer c;
>
>
> I am fairly confident about this patch: would you mind apply it or do
> you want me to do more testing ?
>
It looks good. I've applied the patch: 7c98934dcccd in ns-3-dev.
--
Raj Bhattacharjea
Georgia Institute of Technology
School of Electrical and Computer Engineering
Ph.D. Candidate
Systems Analyst
404.894.2955
More information about the Ns-developers
mailing list