SIMULATION OF URBAN MOBILITY (SUMO)
INSTALLATION AND OVERVIEW
Jaskaran Preet Singh
• SUMO is an open source traffic simulation package including net import and demand
• The German Aerospace Center (DLR) started the development of SUMO back in
• It involves route choice and traffic light algorithm or simulating vehicular
2. INSTALLING SUMO
1. Download the latest version of SUMO from the following website:
2. Download and install the supporting files required to build SUMO with GUI using
• sudo apt-get install libgdal1-dev proj libxerces-c2-dev
• sudo apt-get install libfox-1.6-dev libgl1-mesa-dev libglu1-mesa-dev
3. Decompress SUMO folder and move inside the folder using ‘cd’ command.
INSTALLING SUMO CONT…
4. Run the following command to configure SUMO:
5. Run “make” command.
6. Run “sudo make install”
7. To check whether SUMO has been installed successfully run:
sumo or sumo-gui
3. WORKING IN SUMO
• In order to create simulation in SUMO first create a road network on which vehicles
• The road network consists of nodes (junctions) and edges (i.e. roads that connect
various junctions with each other).
• Road network can be created in three ways:
1. Manually by creating your own node file, edge file and connection file.
2. Using NETGENERATE command.
3. Importing road network from non SUMO formats like OSM, VISSIM, VISUM etc.
3.1. CREATING ROAD NETWORK MANUALLY
• To begin with create a node file and name it as filename.nod.xml.
• In the node file specify the attributes of every node namely node id, x-y coordinates,
node type (priority, traffic_light etc.).
<node id="1" x="-250.0" y="0.0" type=“traffic_light”/>
<node id="2" x="+250.0" y="0.0" />
<node id="3" x="+251.0" y="0.0" type=“priority”/>
• After defining nodes connect nodes with each other using edges. Make a separate edge
file filename.edg.xml and define various edges.
• Edges are directed, thus every vehicle travelling an edge will start at the node given in
“from” attribute and end at the node given in “to” attribute.
<edge from="1" id="1to2" to="2" type=“a”/>
<edge from="2" id="out" to="3" type=“c”/>
• Here “id” is the unique id of every edge and type specify the characteristics of edge.
• Characteristics of each edge like number of lanes, priority of each lane within the
edge, speed limit of lane can be specified in additional file with extension .type.xml or
edge file itself.
• Edge type file (filename.type.xml) can be written as:
<type id="a" priority="3" numLanes="3" speed="13.889"/>
<type id="b" priority="3" numLanes="2" speed="13.889"/>
<type id="c" priority="2" numLanes="3" speed="13.889"/>
• To specify traffic movements and lane connections an additional file with extension
.con.xml is required.
• For example:
<connection from="L2" to="L12" fromLane="0" toLane="0"/>
• The above example tells that lane 0 of edge L2 is connected to lane 0 of edge L12.
• After creating nodes and edges use the SUMO tool NETCONVERT to create a road
• Run following command to create a road network:
netconvert --node-files=file.nod.xml --edge-files=file.edg.xml –outputfile=file.net.xml
• This will generate a road network in file file.net.xml.
• A vehicle in SUMO consists of three parts:
vehicle type which describes the vehicle's physical properties like length, acceleration and
deceleration, colour and maximum speed,
a route the vehicle shall take,
and the vehicle itself.
• Both routes and vehicle types can be shared by several vehicles.
• Create a route file filename.rou.xml and define routes and vehicle types in it.
• Definition of vehicles and there routes:
<vType accel="1.0" decel="5.0" id="Car" length="2.0" maxSpeed="100.0" sigma="0.0" />
<route id="route0" edges="1to2 out"/>
<vehicle depart="1" id="veh0“ route="route0" type="Car" />
• Tag vType defines the type of vehicle and its properties like id, acceleration,
deceleration, length, colour, sigma (driver’s imperfection) etc.
• Tag route contains the edges given in sequence order that a vehicle will follow.
• Finally the vehicle tag creates a vehicle ‘veh0’ that will follow the route specified in
• Now glue everything together into a configuration file
• Now start simulation by either sumo -c filename.sumocfg or with GUI by sumo-gui -c
3.2. USING NETGENERATE
• Road network can also be created using tool NETGENERATE.
• With NETGENERATE there is no need to make node and edge files.
• Using NETGENERATE three types of networks can be created:
1. Grid like network
2. Spider like network
3. Random network
3.2.1. GRID LIKE NETWORK
• For creating a grid network specify the number of junctions required in x and y
direction using --grid-x-number and --grid-y-number respectively.
• Also specify distance between junctions using --grid-x-length and --grid-y-length.
• The command for generating grid network is as follows:
netgenerate --grid-net --grid-x-number=3 --grid-y-number=3 --grid-y-length=200 --grid-x-
GRID LIKE NETWORK
Fig 3.1 : Grid like network generated using NETGENERATE.
3.2.2. SPIDER LIKE NETWORK
• Spider-net networks are defined by the number of axes dividing them, the number of
the circles they are made and the distance between the circles.
• The command for generating grid network is as follows:
netgenerate --spider-net --spider-arm-number=10 --spider-circle-number=10 --
• It will generate a network file file.net.xml.
SPIDER LIKE NETWORK
Fig 3.2: Spider like network generated using NETGENERATE.
3.2.3. RANDOM NETWORK
• The random network generator generates random road network.
• The command for generating random network is as follows:
netgenerate --rand -o file.net.xml --rand.iterations=200
Fig 3.3: Random network generated using NETGENERATE
3.3. IMPORTING NON-SUMO NETWORKS
• Using SUMO’s NETCONVERT tool one can import road networks from different
• Presently following formats are supported:
1. OpenStreetMap databases (OSM database)
2. PTV VISUM
3. PTV VISSIM
4. OpenDRIVE networks
5. MATsim networks
6. SUMO networks
3.3.1. IMPORTING DATA FROM OSM
• OpenStreetMap is a free editable map of the whole world.
• Road network of any geographic area can be downloaded from the website
• The data from OpenStreetMap database is saved in XML structure and the saved file
has an extension .osm or .osm.xml.
• This file can be converted to SUMO’s network file using “netconvert” as:
netconvert --osm-files filename.osm.xml –o filename.net.xml
3.3.2. EDITING OSM NETWORKS
• Before converting OSM data to SUMO’s network format, the OSM data can be edited
to remove unwanted features.
• The OSM data can be edited using:
1. Java Open Street Map (JOSM) editor.
2. OSMOSIS editor.
• Both these editors are based on Java.
Fig. 3.4: OSM file of Chandigarh city opened in JOSM
Fig. 3.5: SUMO net file of Chandigarh city opened in sumo-gui
4. DEMAND MODELLING IN SUMO
• After generating network description of vehicles can be added using various tools provided in
• Generally movement of vehicle can be described in two ways:
1. Trip: A trip is a vehicle movement from one place to another defined by the starting edge (street), the
destination edge, and the departure time.
2. Route: A route is an expanded trip, that means, that a route definition contains not only the first and the
last edge, but all edges the vehicle will pass.
• Tools used for generating routes:
1. OD2TRIPS: OD2TRIPS converts O/D (origin/destination) matrices into trips. These
trips can then be converted to routes.
• Origin and destination points are the districts or traffic assignment zones (TAZ) stored in SUMO
• It only support data from VISUM/VISSIM formats.
2. JTRROUTER: JTRROUTER is a routing applications which uses flows and turning
percentages at junctions as input to generate routes.
3. DFROUTER: DFROUTER directly use the information collected by observation
points to rebuild the vehicle amounts and routes.
• Observation points are the detectors that observe road situation like amount of traffic or type of
4. DUAROUTER import routes or their definitions from other simulation packages and
for computing routes using the Dijkstra shortest-path algorithm.
• It takes trip or flow file as input and generate the route file.
EXAMPLE – VEHICLES TAKING ALTERNATE
ROUTE TO AVOID TRAFFIC JAM
• Daniel Krajzewicz, Jakob Erdmann, Michael Behrisch, and Laura Bieker.
"Recent Development and Applications of SUMO - Simulation of Urban
MObility"; International Journal On Advances in Systems and Measurements, 5
(3&4):128-138, December 2012.