Realistic vehicle mobility models

364 views
Skip to first unread message

Boong Baang

unread,
Feb 3, 2020, 8:46:57 PM2/3/20
to ns-3-users
I implemented a basic VANET scenario where the vehicles move in a fixed speed throughout the simulation and broadcasts BSMs using WAVE. If I want to modify the code so that the vehicles move in changing speeds, i.e. it doesn't move at constant speeds throughout the simulation, how should I do that ?

I also need to ensure that the scenario is realistic. Eg. if a vehicle is changing speed, the vehicle behind it responds and decreases it's speed or moves into a different lane.  How should I go about implementing it ?

I found that we can construct a realistic mobility scenario using SUMO. So if I import such a scenario, how do I replace my old mobility model with the new SUMO scenario. I found the program "vanet-routing-compare.cc" has an option of incorporating such SUMO files (after appropriate changes), but how do I do it for the my program.

I am attaching the original ns3 program, please let me know of any ways using which I can incorporate realistic mobility for the vehicles.
mod.cc

Boong Baang

unread,
Feb 3, 2020, 9:20:38 PM2/3/20
to ns-3-users
Does adding the following lines in place of the existing mobility enough, or more changes are needed ?

     // Create Ns2MobilityHelper with the specified trace log file as parameter
     
Ns2MobilityHelper ns2 = Ns2MobilityHelper (m_traceFile);
      ns2
.Install (); // configure movements for each node, while reading trace file
     
// initially assume all nodes are not moving
     
WaveBsmHelper::GetNodesMoving ().resize (m_nNodes, 0);


Message has been deleted

Edivaldo

unread,
Feb 4, 2020, 2:37:17 PM2/4/20
to ns-3-users
Hello Boong Baang, how are you?

You can use the SUMO program to simulate a vehicular traffic environment, through an existing area or geographical route using the OpenStreetMap tool.

Vanet-routing-compare.cc can perform a synthetic simulation (included in the code itself) -> m_scenario == 1 and m_mobility = 2 or a realistic scenario through the mobility file (SUMO): low99-ct-unterstrass-1day. filt.7.adj.mob, in which -> m_scenario == 2 and m_mobility = 1.

Attached I have a mobility file (SUMO = ibira.mob) and a code (NS3 = mob_ibira.cc) to exemplify the mobility of the nodes through the assistant NS2MobilityHelper. Number of nodes = 10 (vehicles) and total simulation time 112.0 seconds.

You can view the nodes in progress, through NetAnim, with the file (.xml) generated in the simulation.

I don't know if you've already learned SUMO or OSM, but it helped me a lot in the beginning:
- Several classes on SUMO -> https://www.youtube.com/watch?v=9MyIABer_NY

I wish you success, health and peace.

Sincerely,
Edivaldo
ibira.mob
mob_ibira.cc

Boong Baang

unread,
Feb 4, 2020, 2:57:56 PM2/4/20
to ns-3-users
Hi Edivaldo, I am good. Hope you're doing well too.
Thanks for the help and attaching the files. Will update here on the progress.

Sunny

unread,
Feb 6, 2020, 5:46:01 AM2/6/20
to ns-3-users
Hi dear,

Yes, you can easily incorporate your own mobility scenario (generated by SUMO) in the same program "vanet-routing-compare.cc" just by replacing the existing mobility file name in your own file and give the option of scenario=2 while running the program. and dont forget to mention the number of nodes and ofcourse simulation time.
Hope this helps you. 

Sunny

unread,
Feb 6, 2020, 5:47:00 AM2/6/20
to ns-3-users
No need to change anything in this code.

Boong Baang

unread,
Feb 6, 2020, 10:49:44 AM2/6/20
to ns-3-users
Thanks everyone for your help, I was able to generate a .tcl file from SUMO and use it on the program I wanted to. Right now I am facing a problem that relates to SUMO: I took an area of Manhattan in open street maps and generated some number of vehicles. But the problem is that:

1. The number of vehicles at any point in the simulation doesn't remain the same (a key requirement for me) as vehicles enter and leave the simulation at the map boundaries. I found some discussions on how to keep a fixed number of vehicles in the simulation (like making the vehicles follow a circular route in the map), but didn't get anything conclusive.

2. When I look at the speed distribution of the vehicles, around 90% of the vehicles have 0 speed in my ns3 log. Is it because the vehicles that haven't entered the map or left the map has their velocities as 0 ?

Finally, is there a way I can design a route over SUMO where all the vehicles are generated at once and the vehicles follow a fixed route so that vehicle density remains same throughout ?

I understand that this is more of a question for SUMO forum, but I have posted here to know if someone has implemented it before ? 

Edivaldo

unread,
Feb 6, 2020, 1:19:36 PM2/6/20
to ns-3-users
Hi Boong,

Try to subscribe to the SUMO user list:

Health and peace..

Zenouska Murphy

unread,
Feb 8, 2020, 6:31:01 AM2/8/20
to ns-3-users
When implementing your own mobility file, you are asked to fill in the node speed. Does this speed override the speeds of each vehicle in the mobility file you are using or is this speed entered ignored? 

Biplav Choudhury

unread,
Feb 8, 2020, 8:23:04 AM2/8/20
to ns-3-...@googlegroups.com
As far as I know, the speed specified in the sumo file is final. Which is there other way of specifying speed ? 

Séanadh Ríomhphoist/

Email Disclaimer

Tá an ríomhphost seo agus aon chomhad a sheoltar leis faoi rún agus is lena úsáid ag an seolaí agus sin amháin é. Is féidir tuilleadh a léamh anseo. 

This e-mail and any files transmitted with it are confidential and are intended solely for use by the addressee. Read more here. 

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/korTZCgR15w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/f3a56a3b-1875-4e52-9297-acfe3077213f%40googlegroups.com.

Zenouska Murphy

unread,
Feb 8, 2020, 8:46:50 AM2/8/20
to ns-3-users
In this example the node speed is set to be 20. So I am wondering how this works with the mobility file which already has the speeds of each vehicle.


On Saturday, 8 February 2020 13:23:04 UTC, Boong Baang wrote:
As far as I know, the speed specified in the sumo file is final. Which is there other way of specifying speed ? 

On Sat, Feb 8, 2020, 6:31 AM Zenouska Murphy <zenousk...@mail.dcu.ie> wrote:
When implementing your own mobility file, you are asked to fill in the node speed. Does this speed override the speeds of each vehicle in the mobility file you are using or is this speed entered ignored? 

On Thursday, 6 February 2020 10:46:01 UTC, Sunny wrote:
Hi dear,

Yes, you can easily incorporate your own mobility scenario (generated by SUMO) in the same program "vanet-routing-compare.cc" just by replacing the existing mobility file name in your own file and give the option of scenario=2 while running the program. and dont forget to mention the number of nodes and ofcourse simulation time.
Hope this helps you. 

On Tuesday, February 4, 2020 at 2:46:57 AM UTC+1, Boong Baang wrote:
I implemented a basic VANET scenario where the vehicles move in a fixed speed throughout the simulation and broadcasts BSMs using WAVE. If I want to modify the code so that the vehicles move in changing speeds, i.e. it doesn't move at constant speeds throughout the simulation, how should I do that ?

I also need to ensure that the scenario is realistic. Eg. if a vehicle is changing speed, the vehicle behind it responds and decreases it's speed or moves into a different lane.  How should I go about implementing it ?

I found that we can construct a realistic mobility scenario using SUMO. So if I import such a scenario, how do I replace my old mobility model with the new SUMO scenario. I found the program "vanet-routing-compare.cc" has an option of incorporating such SUMO files (after appropriate changes), but how do I do it for the my program.

I am attaching the original ns3 program, please let me know of any ways using which I can incorporate realistic mobility for the vehicles.

Séanadh Ríomhphoist/

Email Disclaimer

Tá an ríomhphost seo agus aon chomhad a sheoltar leis faoi rún agus is lena úsáid ag an seolaí agus sin amháin é. Is féidir tuilleadh a léamh anseo. 

This e-mail and any files transmitted with it are confidential and are intended solely for use by the addressee. Read more here. 

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/korTZCgR15w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-...@googlegroups.com.
ns3.JPG

Sanaullah Faiz

unread,
Feb 8, 2020, 8:52:09 AM2/8/20
to ns-3-...@googlegroups.com

Yes, you are right. I am also confused on this point, that what is meant by mentioning the speed here?
Sent from my iPhone

On 08-Feb-2020, at 14:47, Zenouska Murphy <zenouska...@mail.dcu.ie> wrote:


To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/a0cfcbe9-b111-4948-a8af-eb38cc6bb3f7%40googlegroups.com.
<ns3.JPG>
Reply all
Reply to author
Forward
0 new messages