-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsumo.qmd
More file actions
160 lines (97 loc) · 7.69 KB
/
sumo.qmd
File metadata and controls
160 lines (97 loc) · 7.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
---
title: "SUMO"
author: "R Félix"
bibliography: references.bib
---
In this tutorial we will guide you to install and start using SUMO.
[SUMO](https://eclipse.dev/sumo/about/) is a free and open source traffic simulation suite.
It is available since 2001 and allows modelling of intermodal traffic systems - including road vehicles, public transport and pedestrians.
Included with SUMO is a wealth of supporting tools which automate core tasks for the creation, the execution and evaluation of traffic simulations, such as network import, route calculations, visualization and emission calculation [@SUMO2018].
SUMO is available for any operating system.
## Installation
### Windows
The installation of SUMO in Windows is pretty straightforward.
Visit <https://eclipse.dev/sumo/> and download the installation file (137 MB).

Open the downloaded file and execute in your computer.
Accept the defaults and install.
### Mac OS
> soon.
> 🐼
### Linux
In debian based (ubuntu, kubuntu, popOS, debian) follow this instructions.
```sh
sudo add apt-repository ppa:sumo/stable
sudo apt update
sudo apt install sumo sumo-tools sumo-doc
```
## Getting started
Open SUMO-gui (Graphic User Interface).
You should have a window like this:
{width="615"}
Several tutorials are available.
Try these ones:
- [Hello World](https://sumo.dlr.de/docs/Tutorials/Hello_World.html) - Creating a simple network and demand scenario with [netedit](https://sumo.dlr.de/docs/Netedit/index.html) and visualizing it using [sumo-gui](https://sumo.dlr.de/docs/sumo-gui.html)
- [OSMWebWizard](https://sumo.dlr.de/docs/Tutorials/OSMWebWizard.html) - Setting up a scenario with just a few clicks using osmWebWizard.py; getting a network from **OpenStreetMap**
- [Quick Start](https://sumo.dlr.de/docs/Tutorials/quick_start.html) - A more complex tutorial with [netedit](https://sumo.dlr.de/docs/Netedit/index.html); first steps in SUMO
- [Driving in Circles](https://sumo.dlr.de/docs/Tutorials/Driving_in_Circles.html) - Work with [netedit](https://sumo.dlr.de/docs/Netedit/index.html); define a flow; let vehicles drive in circles using rerouters
- [SUMOlympics](https://sumo.dlr.de/docs/Tutorials/SUMOlympics.html) - Create special lanes and simple traffic lights in netedit, more about flows and vehicle types, working with vehicle
- [Autobahn](https://sumo.dlr.de/docs/Tutorials/Autobahn.html) - Build a highway, create a mixed highway flow, visualize vehicle speed, save view settings
- [Importing GTFS](https://sumo.dlr.de/docs/Tutorials/GTFS.html) - Importing public transport schedules from public sources using the General Transit Feed Specification
{{< video https://www.youtube.com/watch?v=9WCGxJDdY9s >}}
### Import from OpenStreetMap
This requires having [Python](https://www.python.org/downloads/) installed.
- Windows: *Start -\>* *All Programs -\> OSM Web Wizard*
- MacOS: 🐼
- Linux (terminal):
``` sh
cd ~/sumo/tools
python3 osmWebWizard.py
```
And a window will open in your browser.

You may zoom and pan to the area of your interest[^1].
Click on "Select Area" and draw a rectangle with your mouse for which you wish to generate the simulation scenario.
[^1]: Caution: if the map excerpt covers a very large area, the simulation might become slow or even unresponsive.
We suggest choosing a similar zoom level as in the initial view.
#### Network Generation
The infrastructure import from OSM into the SUMO simulation are affected by different Wizard options
- by default the "Add Polygon" checkbox is checked and a road traffic simulation is generated but all types of roads and rails will be imported as well (cycle paths, footpaths, railways etc)
- if the checkbox "left-hand Traffic" is enabled, the network will be built with left hand traffic rules. For most geographic regions where this is required, this feature will be enabled automatically but if it does not work, this option can be used as a remedy.
- if the checkbox "Car-only Network" is enabled, then only roads that permit passenger car traffic will be included. This can be used to reduce the network size and also helps to reduce intersection complexity
- if the checkbox "Import Public Transport" is enabled, then busStops and trainStops will be exported. Also busses, trams and trains will be generated that follow the public transport routes defined in OSM (but they will follow synthetic schedules).
- if the Demand-checkbox "Bicycles" is active, then extra bicycle lanes will be added to roads where OSM contains this information
- if the Demand-checkbox "Pedestrians" is active, then sidewalks and pedestrian crossings will be generated
#### Demand Generation
The demand is defined by the demand generation panel.
You activate this panel by clicking on the car pictogram.
{width="284"}
SUMO supports various modes of transport.
At the demand generation panel, you can activate/deactivate the individual modes of transport by clicking the corresponding checkboxes.
For each mode of transport, the OSM Web Wizard generates random demand based on a certain probability distribution, which is influenced by two parameters:
- Every time a new vehicle is generated, the OSM Web Wizard randomly chooses a departure and arrival edge for the vehicle. The *Through Traffic Factor* defines how many times it is more likely for an edge at the boundary of the simulation area being chosen, compared to an edge entirely located inside the simulation area. A big value for the *Through Traffic Factor* implies that many vehicles depart and arrive at the boundary of the simulation area, which corresponds to a scenario with a lot of through traffic.
- The *Count* parameter defines how many vehicles are generated per hour and lane-kilometer. Assuming
- the network contains 3 edges with a combined length of 5 km
- that each has 2 lanes which allows the current traffic mode
- and the count value is set to 90,
- then 5 \* 2 \* 90 = 900 vehicles per hour will be generated.
This translates to a [randomTrips](https://sumo.dlr.de/docs/Tools/Trip.html#randomtripspy) parameter of p=4 which means a new vehicle is inserted every 4 seconds somewhere in the network.
The next step is generating and running the scenario.
#### Road-Type Selection
In the Road-Type tab of the OSM Web Wizard one can define which road types to be downloaded and rendered.
{width="225"}
For example, one can only choose motorways, primary, secondary and tertiary to simulate major traffic.
This impacts the file size of the OSM map data.
By default, all road types are checked which implies downloading and rendering all roads.
Unchecking the "Add Polygon" checkbox in the Demand Generation section disables downloading and rendering non-road objects like buildings, waterways, etc. resulting in a smaller file size.
#### Generating and Running the scenario
The complete scenario will be generated automatically once *Generate Scenario* in the control panel has been clicked.
The scenario generation takes a couple of seconds or minutes (depending, among other factors, on the size of the scenario).
Once the scenario generation process has finished, the sumo-gui starts and the simulation can be started by pressing the *Play* button.
 You will see agents making their trips.
Adjust the *Delay* to make it faster or slower.
{width="603"}
A new directory under your user folder *`~/SUMO/yyyy-mm-dd-hh-mm-ss`* will be created to host the data and results.
You may now edit those files and re-run the simulation (open `run` file).
### Use the case study data
> Soon 🥽