how to place a node inside a box, and move to a specific position within this box.

26 views
Skip to first unread message

Jen Tran

unread,
Feb 28, 2017, 12:55:42 AM2/28/17
to ns-3-users
Currently, I can move by using .SetVelocity() as following:

        MobilityHelper mobility;
mobility.SetMobilityModel ("ns3::ConstantVelocityMobilityModel");
mobility.Install (staContainer);
        Ptr<ConstantVelocityMobilityModel> mob = staContainer.Get(0)->GetObject<ConstantVelocityMobilityModel>();
mob->SetVelocity(Vector(20, 0, 0));   //go to the right

- But there is no boundary so I have to manage the time and velocity so that it won't move outside my "imaginary" boundary. Is there other way? 
- Is there a way to define a box, place a node at a position within this box, move the node to another position within a box?

Tommaso Pecorella

unread,
Mar 3, 2017, 11:48:10 AM3/3/17
to ns-3-users
Hi,

I think you'll have to extend the ConstantVelocity model. Actually there's no model doing what you mention, also because it's not obvious what the node should do when it will hit the boundary.

T.
Reply all
Reply to author
Forward
0 new messages