<div dir="ltr"><div><div><div><div><div>Hi,<br> <br></div>Thanks for your reply.<br></div>And would you pls answer me another question.<br></div>What if I used several <tt class=""><span class="">ns3::RandomVariable at different places of my simulation, e.g., Besides in consumer, one in forwarding </span></tt>strategy. Would that specifying  --RngRun in command line works for all them?<br>
<br></div>Thanks,<br></div>Xiaoyan<br> </div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 24, 2013 at 2:49 AM, Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi!<div><br></div><div>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.</div>
<div><br></div><div>The link that Xiaoke posted explains everything about randomization in NS-3.  </div><div><br></div><div>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.</div>
<div><br></div><div>---</div><div>Alex</div><div><br></div><div><br><div><div><div class="h5"><div>On Apr 23, 2013, at 8:15 AM, Xiao yan Hu <<a href="mailto:xhbreezehu@gmail.com" target="_blank">xhbreezehu@gmail.com</a>> wrote:</div>
<br></div></div><blockquote type="cite"><div><div class="h5"><div dir="ltr">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. </div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Apr 23, 2013 at 10:42 PM, Xiaoke Jiang <span dir="ltr"><<a href="mailto:shock.jiang@gmail.com" target="_blank">shock.jiang@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I think you have to set different seed for in order to generate different traffic pattern.<div>

<br></div><div>set seed: <a href="http://www.nsnam.org/docs/manual/html/random-variables.html" target="_blank">http://www.nsnam.org/docs/manual/html/random-variables.html</a></div><div>have a try!</div><div><br><div>
<div><div style="color:rgb(34,34,34);font-size:small;font-family:arial"><font face="'comic sans ms', sans-serif">thanks</font><br><br><font face="garamond, serif"><font size="4">My Regards,</font><br></font></div>

<hr style="color:rgb(34,34,34);font-size:small;font-family:arial;width:210px;min-height:1px" size="1" align="left"><div style="color:rgb(34,34,34);font-size:small;font-family:arial"><font face="garamond, serif"><div>
<span style="font-size:10.5pt">Xiaoke Jiang (蒋小可)</span></div><div><span style="font-size:10.5pt"><br></span></div><div><div><span style="font-size:10.5pt"><font color="#666666">Ph.D Candidate,</font></span></div>
<div><span style="font-size:10.5pt"><font color="#666666">Dept. of Computer Science and Technology,</font></span></div><div><span style="font-size:10.5pt"><font color="#666666">Tsinghua University, P. R. China</font></span></div>

</div></font></div></div>
</div><div><div>
<br><div><div>On Apr 23, 2013, at 10:40 PM, Xiao yan Hu <<a href="mailto:xhbreezehu@gmail.com" target="_blank">xhbreezehu@gmail.com</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr">Hi Xiaoke and Alex,<div>

<br></div><div>I used <span style="font-family:arial,sans-serif;font-size:19px">ndn-</span><span style="font-family:arial,sans-serif;font-size:19px">zipf</span><span style="font-family:arial,sans-serif;font-size:19px">-</span><span style="font-family:arial,sans-serif;font-size:19px">mandelbrot</span><span style="font-family:arial,sans-serif;font-size:19px">.cc as the consumer in my simulations.</span></div>


<div><span style="font-family:arial,sans-serif;font-size:19px">It is cool and thank you guys.</span></div><div><span style="font-family:arial,sans-serif;font-size:19px">But I found that the app generates exactly the same Interest traffic for different runs of the simulations.  </span></div>


<div><span style="font-family:arial,sans-serif;font-size:19px">Would you please tell me if there is a way that some randomness can be  added in each run of the generated Interest traffic?</span></div><div><span style="font-family:arial,sans-serif;font-size:19px"><br>


</span></div><div><span style="font-family:arial,sans-serif;font-size:19px">Thanks,</span></div><div><span style="font-family:arial,sans-serif;font-size:19px">Xiaoyan</span></div><div class="gmail_extra"><br><br>
<div class="gmail_quote"><br></div></div></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br></div></div></div><div class="im">
_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
</div></blockquote></div><br></div></div></blockquote></div><br></div>