Set random position allocator for each simulation

81 views
Skip to first unread message

Matteo Bordin

unread,
May 20, 2021, 7:10:20 AM5/20/21
to ns-3-users
Hi,
I would like to set my node with random coordinates in a rectangle. Now I'm using

uemobility.SetPositionAllocator ("ns3::RandomRectanglePositionAllocator",
                                  "X", StringValue ("ns3::UniformRandomVariable[Min=0|Max=500.0]"),
                                  "Y", StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=500.0]"));

but every time I run the simulation I get the same position.
eg. Every time I run the simulation, the first 2 nodes always have the following coordinates
x=470.743, y=183.2, z=0
x=376.579, y=230.287, z=0
What should I use to get different positions each time I run a simulation?

Alexander Krotov

unread,
May 20, 2021, 12:11:58 PM5/20/21
to ns-3-...@googlegroups.com

> What should I use to get different positions each time I run a simulation?

Message has been deleted

Matteo Bordin

unread,
May 21, 2021, 3:34:01 AM5/21/21
to ns-3-users
So do I have to pass manually every time a different number as parameter for RngRun?
Reply all
Reply to author
Forward
0 new messages