Set MobilityHelper at a specific time

24 views
Skip to first unread message

Thiago

unread,
Dec 9, 2015, 3:37:18 PM12/9/15
to ns-3-users
Dear NS-3 colleagues,

I have a multi-hop wireless scenario with 10 nodes using OLSR where all nodes are in range at the beginning of the simulation (t = 0 s).
The nodes are initially in a grid fashion, and I want to move half of them away (separate client and server) at time x (say, t = 60 s) to simulate partition.

Turning off the nodes is not a solution in this case.

The random 2D direction described in https://www.nsnam.org/wiki/MobilityHelper is the closest option, but I want to move the nodes to a specific direction.


Should I stop the simulation, change the mobility pattern, and start the simulation again? What is the best approach?


Thanks for your help,
Thiago

Konstantinos

unread,
Dec 9, 2015, 5:46:12 PM12/9/15
to ns-3-users
Hi Thiago,

You can install different mobility models to different nodes, so for the half of them you can install static position and the rest you can have the random2d model you want.
To enable the movement after some time as you said, you can initially set the speed to zero, and have an event to change it at a given (random) speed.

Regards,
K.
Reply all
Reply to author
Forward
0 new messages