[ndnSIM] Zipf-Mandelbrot Patch for ndnSIM
alexander.afanasyev at ucla.edu
Tue Apr 23 11:49:46 PDT 2013
Using srand is not an ideal way to produce different random results in the simulator, as the simulator suppose to produce exactly the same output based on input parameters, one of which is RngRun.
The link that Xiaoke posted explains everything about randomization in NS-3.
What I'm usually doing is adding a standard command line argument to the simulation run, e.g., --RngRun=2 for the second run and --RngRun=3 for the third and so on (RngRun is not exactly a seed and you don't need to "randomize" it, as you normally suppose to do with srand). To use this standard argument, you need to have "CommandLine cmd; ... cmd.Parse (argc, argv);" present in your code.
On Apr 23, 2013, at 8:15 AM, Xiao yan Hu <xhbreezehu at gmail.com> wrote:
> Thank you. And I just found that if I call srand() in the main, some randomness generates as well. But your reference should be better.
> On Tue, Apr 23, 2013 at 10:42 PM, Xiaoke Jiang <shock.jiang at gmail.com> wrote:
> I think you have to set different seed for in order to generate different traffic pattern.
> set seed: http://www.nsnam.org/docs/manual/html/random-variables.html
> have a try!
> My Regards,
> Xiaoke Jiang （蒋小可）
> Ph.D Candidate,
> Dept. of Computer Science and Technology,
> Tsinghua University, P. R. China
> On Apr 23, 2013, at 10:40 PM, Xiao yan Hu <xhbreezehu at gmail.com> wrote:
>> Hi Xiaoke and Alex,
>> I used ndn-zipf-mandelbrot.cc as the consumer in my simulations.
>> It is cool and thank you guys.
>> But I found that the app generates exactly the same Interest traffic for different runs of the simulations.
>> Would you please tell me if there is a way that some randomness can be added in each run of the generated Interest traffic?
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ndnSIM