12.07.2015 Views

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 25.1: Overall arrangement of streams <strong>and</strong> substreams. [18]25.1.1 Seeding <strong>The</strong> RNGDue to the n<strong>at</strong>ure of the RNG <strong>and</strong> its implement<strong>at</strong>ion, it is not necessary to set a seed (the default is 12345). If you wish tochange the seed, functio<strong>ns</strong> are available. You should only set the seed of the default RNG. Any other RNGs you cre<strong>at</strong>e areautom<strong>at</strong>ically seeded such th<strong>at</strong> they produce independent streams. <strong>The</strong> range of valid seeds is 1 to MAXINT.To get non-deterministic behavior, set the seed of the default RNG to 0. This will set the seed based on the current time ofday <strong>and</strong> a counter. This method should not be used to set seeds for independent replic<strong>at</strong>io<strong>ns</strong>. <strong>The</strong>re is no guarantee th<strong>at</strong>the streams produced by two r<strong>and</strong>om seeds will not overlap. <strong>The</strong> only way to guarantee th<strong>at</strong> two streams do not overlap is touse the substream capability provided by the RNG implement<strong>at</strong>ion.Example# Usage: <strong>ns</strong> rng-test.tcl [replic<strong>at</strong>ion number]if {$argc > 1} {puts "Usage: <strong>ns</strong> rng-test.tcl \[replic<strong>at</strong>ion number\]"exit}set run 1if {$argc == 1} {221

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!