Random position Allocation of the Nodes

640 views
Skip to first unread message

Samad Riaz

unread,
Sep 12, 2015, 5:15:03 PM9/12/15
to ns-3-users
I need a little help from you. As you know when we create Nodes in NS3 they got their position when we use "Mobility helper" in my code i am using MobilityHelper mobility; mobility.SetPositionAllocator ("ns3::RandomDiscPositionAllocator", "X", StringValue ("100"), "Y", StringValue ("150"), "Rho", StringValue ("ns3::UniformRandomVariable[Min=0|Max=60]")); mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); mobility.Install (c); and it allocate the position of let say 10 nodes like the picture above. when ever i run my code the position of these nodes remain same.

But i want the position of these nodes should be random . like when ever i run the code the position should be random. not same as it was in the previous run. Can you please help me to make the position allocation randamize ??
Screenshot from 2015-09-10 23^%39^%10.png

Tommaso Pecorella

unread,
Sep 12, 2015, 5:27:18 PM9/12/15
to ns-3-users
Hi,

the answer is in the manual, but you didn't open it :P
No, seriously, it's the second manual chapter, and the first one is "Organization". Since I hardly can classify "Organization" as a chapter, I'd say that you didn't read the first manual chapter.
Ok, I understand that reading the full manual is boring, but at least one should read the index, isn't it ?
Now, a section named "Seeding and independent replications" could (not necessarily) contain useful informations about your problem ?

Have fun reading, and since you're at it, look at the rest of the manual too. It could be useful in the future.

T.
Reply all
Reply to author
Forward
0 new messages