On Jan 12, 2007, at 8:00 PM, [EMAIL PROTECTED] wrote:
> for the sake of completion.
>> Luqman wanted us to know:
>>
>> Though errors are inserted in the received packets these errors  
>> occur at
>> the same place during every run of simulation.
>>
>> I think this is not intended so. Random variable should contain
>> different numbers every time random function is called.
>
> After reading up in the ns-manual while searching for "random" and
> "seed", I found that "ns-ransom 0" choses the seed at run time whereas
> otherwise a static seed was being used.
>
> Hope this helps others with same questions.

Right, the way that the RNG in ns-2 is setup, the default seed is the  
same every time unless you change it.  If you want to make sure that  
the different runs of your experiment are independent, you should use  
the substream feature available in ns-2.

A further description of this can be found in Section 4 of this paper:
M.C. Weigle, Improving Confidence in Network Simulations, Proceedings  
of the Winter Simulation Conference, Monterey, CA, December 2006, pp.  
2188-2194.
http://www.cs.odu.edu/~mweigle/papers/wintersim06.pdf

This paper also contains the same example found in the ns Manual at
http://www.isi.edu/nsnam/ns/doc/node265.html

Essentially, you want to call next-substream enough times to advance  
the random number stream past where you used it in the previous  
experiment.  For example, if you want to run the experiment 3 times:
   1st experiment - call next-substream 0 times
   2nd experiment - call next-substream 1 time
   3rd experiment - call next-substream 2 times

Be VERY careful with setting the seed according to the time of day.   
Unless you print out the seed and record it, you won't be able to  
reproduce an experiment exactly.  More importantly, if you set the  
seed by the time-of-day, there is no way to guarantee that the  
multiple runs of your simulation are independent.

-Michele

--
Michele Weigle
Assistant Professor
Department of Computer Science
Old Dominion University
Norfolk, VA 23539
mweigle at cs.odu.edu
http://www.cs.odu.edu/~mweigle/



Reply via email to