SUMO
Simulation of Urban MObility

- Home
- Download
- Documentation
- Wiki
- Trac
- Blog
- Contact
- SF-Project

# Tutorials/ScenarioGuide

# Introduction

This Tutorial is meant to serve as a high-level guide for building a SUMO scenario. It provides an outline of the typical steps when building a scenario and lists the recommended wiki pages for each step.

Note:
This tutorial assumes familiarity with Tutorials/Hello Sumo and Tutorials/Quick Start

# Build the road network

Every simulation requires a road network. The application NETCONVERT is used to create a network which can be used by the simulation SUMO.

## If you already have some network data

Check whether a direct import is possible: Networks/Import. Otherwise you will need to convert the data to a simple XML-format which can be read by NETCONVERT. Read this page: Networks/Import.

## If you do not yet have any network data

Use publicly available network data from OpenStreetMap as described here: Networks/Import/OpenStreetMapDownload. Then import the network as described here: Networks/Import/OpenStreetMap.

# Generate the traffic

First you should understand the basics of vehicle modelling: Definition_of_Vehicles,_Vehicle_Types,_and_Routes. You have various ways to insert vehicles into the map. Your choice basically depends on what kind of information about the traffic you have: Demand/Introduction_to_demand_modelling_in_SUMO.

# Improve your Scenario

Most methods for network import leave some aspect of deficient network quality. Very often this manifests as unexpected/unrealistic traffic jams and teleporting vehicle errors.

## Miscellaneous Problems

You will have to patch your network data to add missing roads, prohibit some turns, correct the number of lanes and add/remove some traffic lights. The recommended way to perform the necessary changes is this:

1. Encode the changes in plain-xml files as described in Networks/Building_Networks_from_own_XML-descriptions. Most XML-attributes are optional so you only need to set the values you would like to change.
2. patch your network using NETCONVERT by loading the net.xml along with the plain-xml files. You can even use this during the initial import (i.e. load an OSM-file along with your plain-xml files)

## Traffic Light Programs

In almost all cases the traffic light programs will have been guessed by NETCONVERT and turn out different from the real traffic lights. A simple way to improve traffic lights programs is making them start their program cycle at a different time. Experiment with the option --tls.half-offset and all the other --tls.* options of NETCONVERT.

A more powerful way to improve your traffic lights is to give the program explicitly with a tls.xml file.

At this time NETCONVERT only supports the creation of static traffic light programs. For dynamic traffic lights see Tutorials/TraCI4Traffic_Lights.

# Manage Scenarios

If you have two networks A.net.xml and B.net.xml you may wish to find out how they differ. This can be accomplished using the tool <SUMO_HOME> /tools/net/netdiff.py. Running this tool will give you a set of plain-XML difference files. They only contain the differences grouped by deleted, created and changed elements. It is even possible to load these files along with A.net.xml to recreate B.net.xml.

This page was last modified on 4 September 2012, at 14:01.