Four cardinal points in a mobility model

21 views
Skip to first unread message

rockjaz...@gmail.com

unread,
Nov 18, 2016, 5:04:08 PM11/18/16
to ns-3-users
Hello!

 I'm trying to set 4 cardinal points using a mobility model (I chose RandomWalk2dMobilityModel for my simulation).. I've red the documentation, examples and source code of the model and I'm stuck, could someone please give me some ideas to accomplish this since I'm new in both ns3 and C++

So... What I want to do is to set 4 different directions, for example:
 
North (N): 0° = 360°
East (E): 90°
South (S): 180°
West (W): 270°

By doing that my nodes could change direction randomly in some of those 4 options.

Thanks in advance.

Caleb.

Konstantinos

unread,
Nov 18, 2016, 6:01:59 PM11/18/16
to ns-3-users
Hi Caleb,

ns-3 mobility is using a Cartesian (X,Y,Z) coordinate system for reference. The direction is simply the angle of the velocity vector.

You can assume that moving on the X-axis is the longitude (east / west) and the Y-axis is the latitude (north/south).
When your velocity vector has a positive X it moves towards east and when it is negative it moves towards west.
Same for the Y coordinate; positive is north, negative south.

you could make different assumptions though, e.g. have the latitude on X and longitude on Y. 
It's simply a conversion that you need to keep consistent in you model.

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