[ndnSIM] Zipf-Mandelbrot Patch for ndnSIM

Alex Afanasyev alexander.afanasyev at ucla.edu
Tue Apr 23 21:14:50 PDT 2013


Yes, as long as you used random variables provided by NS-3, like the ones you mentioned, all of them are properly initialized via RngRun (technically, they all use the same underlying random stream, which is actually initialized by RngRun).

---
Alex

On Apr 23, 2013, at 9:08 PM, Xiao yan Hu <xhbreezehu at gmail.com> wrote:

> Hi,
>  
> Thanks for your reply.
> And would you pls answer me another question.
> What if I used several ns3::RandomVariable at different places of my simulation, e.g., Besides in consumer, one in forwarding strategy. Would that specifying --RngRun in command line works for all them?
> 
> Thanks,
> Xiaoyan
> 
> 
> On Wed, Apr 24, 2013 at 2:49 AM, Alex Afanasyev <alexander.afanasyev at ucla.edu> wrote:
>> Hi!
>> 
>> 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.
>> 
>> ---
>> Alex
>> 
>> 
>> 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!
>>>> 
>>>> thanks
>>>> 
>>>> 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?
>>>>> 
>>>>> Thanks,
>>>>> Xiaoyan
>>>>> 
>>>>> 
>>>>> 
>>>> 
>>> 
>>> _______________________________________________
>>> ndnSIM mailing list
>>> ndnSIM at lists.cs.ucla.edu
>>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>> 
> 
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130423/e3cbafa2/attachment.html>


More information about the ndnSIM mailing list