Simulation of road traffic using SUMO and OSM

Saturday, 12th August 2017

 



Traffic simulation is the mathematical model of transportation system using computer software for better understanding, desing and operation of the system. Traffic simulation can be used to simulate road transportation (ground transportation), rail transportation, air transportation and other utility network simulations. There are many softwares available to simulate traffic such as Quadstone paramics, VISSUM, VISSIM, AIMSUN which are paid and Matsim, SUMO, Repast, MAINSIM which are free.

SUMO stands for Simulation of Urban Mobility is a open source, high portable road traffic simulation software. SUMO is licensed under GPL.

OpenStreetMap (OSM) is a project to create free editable maps of the world. Same as Wikipedia, the content on OSM is generated by the people like us and made available to people freely. OSM was created by Steve Coast in 2004.

Requirements:-

  1. Python (download it from here).
  2. SUMO (download it from here).
  3. Text editor like notepad or notepad++
  4. Web browser
  5. Working internet connection

Installing python

Step 1: Double click on the downloaded file to initiate installation.

Step 2: Select install for all users.

Step 3: Select a directory for python. You can leave the default values as it is.

Step 4: In customize python, scroll down to the bottom, click on the option "add python.exe to path" and select option "will be installed on the local drive".


Installing SUMO

Step 1: Double click on the downloaded file to initialize the installation.

Step 2: Accept the end user agreement.

Step 3: Check "set SUMO_HOME and adapt PATH and PYTHONPATH".

Step 4: Click next and then install.


Download a map from openstreetmap.org

Step 1: Create a directory "map" on the desktop

Step 2: Head to openstreetmap.org.

Step 3: Search for the area or location or city.

Step 4: Click on "Export" in the top left corner.

Step 5: Then again click on export icon as shown below.

Step 6: When prompted to save, save it with the name map in previously created map directory. The file will be saved with .osm extension.

Step 7: Download this zip file from here and extract its content into map directory. The content of map directory will be map.osm, typemap.xml and map.sumo.cfg.

Step 8: Open a command prompt and navigate to map directory.

Step 9: Run following command in the command prompt. Success will be displayed at the end if the command is successful.

						
	netconvert --osm-files map.osm -o map.net.xml
						
					

Step 10: Run following command in the command prompt

						
	polyconvert --net-file map.net.xml --osm-files map.osm --type-file typemap.xml -o map.poly.xml
						
					

Step 11: Run the following two commands one by one to trace random paths for simulation.

						
	randomTrips.py -n map.net.xml -e 100 -l
	randomTrips.py -n map.net.xml -r map.rou.xml -e 100 -l
						
					

Step 12: Now run the following code which will open SUMO GUI with current working file

						
	sumo-gui map.sumo.cfg
						
					

Step 13: In the SUMO GUI, set delay time, select "real world" from the drop down where it says "standard" and then click on "play" button. When the simulation is running you can view the results by zooming into the map.





Note: You can download all the files from here, extract it and run the last command in the command prompt with extracted directory as current working directory.

Have anything to add or need help, just ping

Remember "Sharing is Caring"

Managed WordPress Hosting Static New

Subscribe

Thank You...

request failed! Contact admin.

Search Your Domain Name Here

WordPress Hosting Offer July
black-seal-1

Connect...