0% found this document useful (0 votes)
22 views84 pages

SUMO_an_introduction_from_a_beginner

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views84 pages

SUMO_an_introduction_from_a_beginner

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 84

Simulation of Urban Mobility

(SUMO)
An Introduction And Activity Based Transport
Modeling Using SUMO
Dr. Eng. Yonas Minalu
[email protected]
About SUMO
• Simulation of Urban Mobility
– An open-source traffic simulator
– Supports traffic flow and individual vehicles

• Website :
• https://sumo.dlr.de/docs/index.html
SUMO can do the following
• Simulate traffic flow and vehicle movement
– Support different kinds of vehicles and lanes
– Support signal control and priority
– Graphic interface
– Multi-level output (network, lane, vehicle, detector)
– Signal timing coordination
– Actuated and fixed signal timing design/performance evaluation
– Pedestrian simulation…etc…
• Import road network
– Manually design
– Import from OpenStreetMap
• Routing
4
5
6
7
8
9
How to create the intersection, roads or
network ?
1. Using coordinate
2. Manual drawing on netedit.exe
3. From open street-map

10
Example 1: Hello SUMO
1. Road network definition and generation
2. Vehicle/flow definition
3. SUMO configuration

http://sumo.dlr.de/wiki/Tutorials/Hello_Sumo
An example: Hello SUMO
1. Road network
– Node (Junctions and intersections)<.nod.xml>
– Edge (road segment) <.edge.xml>
– Compile<.net.xml>
<nodes> <edges>
<node id="1" x="-250.0" y="0.0" /> <edge from="1" id="1to2" to="2" />
<node id="2" x="+250.0" y="0.0" /> <edge from="2" id="out" to="3" />
<node id="3" x="+251.0" y="0.0" /> </edges>
</nodes>

– Write the following code in cmd.exe…….


netconvert --node-files=hello.nod.xml --edge-files=hello.edg.xml --output-file=hello.net.xml
An example: Hello SUMO
2. Vehicle/Flow <.rou.xml>
– Vehicle
– Flow

<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" />
</routes>

http://sumo.dlr.de/wiki/Tutorials/Hello_Sumo
An example: Hello SUMO
3. SUMO configuration
hello.sumocfg
sumo-gui -c hello.sumocfg <configuration>
<input>
<net-
file
value="h
ello.net
.xml"/>
<route-
files
value="h
ello.rou
.xml"/>
http://sumo.dlr.de/wiki/Tutorials/Hello_Sumo </input>
<time>
From Open street map….

15
Zoning, OD, route…….

16
• OD trip generation
od2trips -c odtrips.config.xml -n taz.xml -d od.od -o
odfile.odtrips.xml
• Route
duarouter -c b.duarcfg
• OUTPUT file visualization
sumo-gui -n network file --weight-files FILE --weight-
attribute ATTR -e 86400
17
18
Traffic signals

19
20
21
22
Traffic signals

23
Advanced SUMO
1. Personalize the visualization of vehicles
http://sumo.dlr.de/wiki/Definition_of_Vehicles,_Vehicle_Type
s,_and_Routes#Visualization
2. Import real-world road network
– http://sumo.dlr.de/wiki/Tutorials/OSMWebWizard
– http://sumo.dlr.de/wiki/Tutorials/Import_from_OpenStreetMap

3. Interact with SUMO using TraCI


– http://sumo.dlr.de/wiki/TraCI/Interfacing_TraCI_from_Python
– Get traffic signal and vehicles’ status
– Set traffic signal and vehicles’ status
Tutorial videos
1. Sumo (Simulation of Urban Mobility) Tutorial Part 1: Manually Creation of
Network https://www.youtube.com/watch?v=9MyIABer_NY

2. Sumo (Simulation of Urban Mobility) Tutorial Part 2: From OSM to Network +


Random Trips Simulation https://www.youtube.com/watch?v=LWecm_rCPJw

3. Sumo (Simulation of Urban Mobility) Tutorial Part 3: OD Matrix to trip and route
Generation https://www.youtube.com/watch?v=R6v7wDkvXrk&t=108s

4. SUMO: static traffic signal light https://www.youtube.com/watch?v=xK0tLYIOVJg


Extra videos
https://www.youtube.com/watch?v=5q7WiKiRUC4
https://www.youtube.com/watch?v=R6v7wDkvXrk
https://www.youtube.com/watch?v=zQH1n0Fvxes
25
Activity Based Travel Demand Modeling and
Macroscopic Traffic Simulation of Selected Area
in Bahir Dar City

26
Mobility Models
1. Trip-Based Mobility Models
It predicts aggregated traffic flows.
It consists of four steps, namely;
Trip generation,
Trip distribution,
Mode choice, and
Route assignment
The modeled area is discretized into traffic analysis zones (TAZs), and
the time of day is discretized into time bins.
2. Activity-Based Mobility Models
It based on simulating human behavior to explain and forecast traffic
reactions to transportation policy or system changes.
This model aim to realistically represent the interdependencies of
activities, times, locations, modes, and routes on a microscopic level.

27
Methodolgy
1. Study Area

2. Data Collection

28
Traditional Four Step Modeling

29
Four Step Demand Modeling

1. Trip Production
Average zonal income (Birr/person/month).

30
Four Step Demand Modeling

Calculation of total trips/person/day for production

Regression Model Equation for Trip Production


y(x ) =276.3076X1 + 41.01047X2 -234107
Where, X1= Population and X2= Average Zonal income 31
Four Step Demand Modeling

Calculation of Total trips/person/day for attraction

32
Four Step Demand Modeling

2. Trip distribution

Origin-Destination (OD) matrix

33
Four Step Demand Modeling

Trip Production is less than Trip Attraction

34
Four Step Demand Modeling

Calculation of Impedance factor


For modeling Link Impedance‟ apparent costs are used.
Cost matrix table

35
Four Step Demand Modeling

Calculated Impedance factor

36
Four Step Demand Modeling

Sub zone to Sub zone Trip Distribution

Total trip
adjusted
destination/
attraction is
40380.95 which
is equal to
total trip
production

37
Activity Based Demand Modeling

3
8
Activity Based Demand
Modeling

Activitygen is a package in SUMO software


tool used for activity generation (SUMO, 2017)
The transports means
It supports the activities
• Walking
Work
• Bicycle
School
• Car
Free Time
• Bus

3
9
Activities in SUMO

Work for adults

Work and school

School for children

Activities
During the day
(retired/unemployed)

Free time (friends, Evening (finished


family, sport, their work not too
party…) late)

Night (Adults, with


no children)
4
0
Activity Based Demand
Modeling
In general, Activitygen can generate a SUMO route file based on
The SUMO network file and
The Statistics file (demographics of the area) as input.

SUMO offers the possibility to simulate interactions between


persons and between all vehicle types (Daniel K, 2012)

4
1
Activity Based Demand
Modeling

SUMO road networks represent real-world


networks as graphs where
Nodes are intersections
Roads are edges
Lane contains
Geometry, Vehicle allowed on it, the Maximum speed

4
2
The Study Road Network

4
3
The Study Road Network (Map)
Extracted from Open Street Map (OSM) From Google Map and
Edited

4
4
The Study Road Network
(.Xml)
To make activitygen analysis the road network must be changed in to
an .xml file form. Here it was converted using OSM web wizard
The xml network file comprises
The edge id
Priority
Number of Lanes
What is allowed to passed on that section and width with code

4
5
The Study Road Network
(.Xml)
Examples of edges in xml file form
<edge id="-101827928#0" from="972074823"
to="cluster_1175583525_4880429659" priority="3"
type="highway.residential" shape="2671.96,1350.29 2611.62,1352.36">

Sample project name and OSM name

No Study link name Open Street Map/netedit


ID
1 M1-2 407500010#1
2 BDM-B4 27220838#7
3 MX5-MX3G 337414903#7

4
6
The Statistics or Demographic data

4
7
The Statistics or Demographic
data

One of the most important input data sets for transport modeling is the
population information.
Agent-based transport demand models need high-resolution population
information on the level of single addresses.

4
8
The Statistics or Demographic
General Information data

Attribute Name Values Description


Total number of inhabitants obtained (from 5 kebeles
Inhabitants 42,370
administration)
Total number of households (must be between 0.5 and 1
households 11,930
times the number of adults of the city)
Age under which people are children. This is the first year of
Children Age Limit 18
adulthood
Retirement Age
55 Age under which people can have children home and work
Limit
Car Rate 0.025 Probability for an adult to own a car (2.5%)
Unemployment Probability for an adult in age of work to be unemployed (49%
0.49
Rate ANRS)
Foot Distance Maximum distance one would go by foot instead of another
402m
Limit transportation mean (standard 0.25mile)
Number of people coming everyday into the city for they work
Incoming Traffic 25114 (Video recorded at St George and Papyrus junction and
their legs) 4
Number of inhabitants working outside the city (Video 9
The Statistics or Demographic
data
Population's Age
Population With Age Distribution
Adopted
6500
from
5500
Amhara
Population

4500
Region age
3500
ranges
2500
from
1500
Report
500
by the 0-4 5_10 11_14 15-19 20-24 25-30 31-35 36-40 41-45 45-50 51-55 56-60 61-65 66-80 >80
Series1 5160 3882 4239 4452 4379 6028 3595 3170 1727 1624 1123 739 751 825 675
Central
Age Groups
Statistics 5
0
The Statistics or Demographic
Parameters data
Valu
Attribute Name Description
e
Probability that an adult prefers to take his car instead of a
carPreference 0.8 public transportation mean when both are available (80%
from interview)

meanTimePerKmIn 120s Estimation of the time needed to drive one kilometer (bird's
eye) on the map (City Speed limit 30km/hr or 2 minutes)
City ec
freeTimeActivityRa Probability that a given household, a given day, has a free
0.08 time activity using a car (8% from interview)
te
uniformRandomTra Proportion of the random traffic demand in the whole traffic
0.15 demand (Randomly selected 15%)
ffic
Variance of the normal distribution introduced for slight
departureVariation 600 variations in departure time (human natural variation5 in
1
The Statistics or Demographic
Work Hours data
Opening and closing hour proportions are gathered from interview
To change it in to seconds 12:00*3600 seconds = 43,200 seconds

Hour 6:00AM 7:30AM 8:00PM 8:30AM 9:00AM


Opening
Time Second
43,200
s 5,400 7,200 9,000 10,800
Proportion 0.11 0.09 0.6 0.15 0.05
Hour 12:00AM 3:00PM 5:00PM 6:00PM 7:00PM 9:00PM
Closing
Time Second
21,600
s 32,400 39,600 43,200 46,800 54,000
Proportion 0.03 0.1 0.6 0.2 0.04 0.02

5
2
The Statistics or Demographic
data
Population and Work Position Distribution

Popula
Share of Share of Work / Populat
tion/ Edge Work/
Zon Sub Populati Wor Populatio Work per Edge ion/
Street Edge Length meter
e Zone on (A) k (B) n/ Street Street (F=B* meter
Code (E=A*C (m) (G) (F /G)
(%) (C ) (%) (D) D) (E /G)
)
M1-2 0.3 0.35 3 49 135 0.02 0.36
M1 11 140
M1-8 0.5 0.55 6 77 131 0.05 0.59
M1-2 0.3 0.12 7 52 135 0.05 0.39
1
M2-7 0.15 0.35 4 152 61 0.07 2.49
M2 24 433
M2-6 0.2 0.35 5 152 107 0.05 1.42
M1-8 0.3 0.1 7 43 131 0.05 0.33

5
3
The Statistics or Demographic
data
Adult Proportion (18-35)
Take from
Amhara Adult Ratio (CSA to ANRS) A 37.54%
Region
Total population in the study area B 42, 370
age
Adult population C=A*B 15,908
ranges
Number of households 0.75*C 11,930
from
Total Employed (CSA to ANRS) E 50.29%
Report by
Unemployed adults (1-E)*C 7,908
the
Central
Statistics
Agency of 5
4
The Statistics and Network xml
Files
Sample Network xml files Sample Statistic xml
files

All the above data are fed in to Activitygen by changing the statistics and
network file in to .xml file format
5
5
Activitygen Trips Generation

5
6
Generate Trips in Activitygen

Activitygen
To make activity-based trip generation report we need two basic inputs parameters these
are
The Network file (ABM.net.xml)
The Statistics file (ABM.stat.xml)
the following standard activitygen command was used to generate trips using stat and net
files
At The Command Prompt (CMD)

• <activitygen --net-file=ABM.net.xml --stat-


The out put is Number of Trips or (ABMTRIP.trips.rou.xml)
file=ABM.stat.xml --output-file=ABMTRIP.trips.rou.xml –
random> 5
7
Generate Trips in Activitygen
The activitygen has generated a total of 77,795 individual trips

People, Work and Trips from Activitygen


Total trips finally taken 77,795
92,729
After random traffic 92,729
23,473
Total one day trip 3,496
64,760
Total number of trips 133,016
68,256
After household activities 18,028
0
Working People from
25,114
outside the city 9,276
Working People total 34,390
16,843
City Children 16,844
2,990
Adult Estimation by
25,527
program 20,528
City households 11,930
0 20000 40000 60000 80000 100000 120000 140000

5
8
Generate Trips in Activitygen
All Trips Sorted by Departure Time

16000
Number of Trips per Hour
14000

12000
Number of Trips

10000

8000

6000

4000

2000
Time in Hour Ti
m
0 e
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 (h
r)

5
9
Hourly Trip Variation
The traffic patterns are consistent over the 24 hours of simulation
The number of trips reaches its peak early in the morning and in the afternoon.

16,041 15,498
16000
Trips Trips
14000
12000
No. of trips

10000
8000
6000
4000
2000
0
0 2 4 6 8 10 12 14 16 18 20 22 24
Time of Day (h)
6
0
Generate Trips in Activitygen

Sample Generated Trips in (xml) file format

6
1
Comparing
Four Step Model
and
Activity Based Models

6
2
Four Step vs Activitygen
All Trips Sorted by Departure Time
Four Stage vs Activity Based Modeling
Four Activity
Stage Based
Mode Model 75000
Fixed Trips vary 65000
Trips with time 55000

45000

The 35000

25000
Traditiona
15000
l Method
5000
Ignores
About Four Stage Activty Based Difference
48.1% Modeling Modeling
of
The Trips
Series1 40381 77795 37414

6
3
Mode Choice Assignment
Vehicle is a mode of transport used for the traffic flow in the network for the
simulation and it is defined by
The route the vehicle shall drive along
Vehicle color
Time step at which the vehicle shall enter or leave the network
Lane on which the vehicle shall be inserted or leave the network
Position at which the vehicle shall enter or leave the network
Speed of vehicle

For this project only two mode choices are


considered this are
• Pedestrian and 6
• Passenger cars 4
Route Choice Assignment
The route choice or route assignment is done by combining
The Network File (ABM.net.xml)
The Number of Trip File (ABMTRIP.trips.rou.xml)

Using the standard route choice (duarouter) command at the Command Prompt
(CMD)

The out put (ABMROUTE.rou.xml) shows the route choice of each vehicles with
<duarouter --net-file=ABM.net.xml --route-
time files=ABMTRIP.trips.rou.xml --output-file=ABMROUTE.rou.xml --
ignore-errors>

6
5
Route Choice Assignment

Sample route choice in xml file format

<vehicle id="randUni14833:1" type="random"

depart="5.00" departPos="1.40" arrivalPos="27.75"

arrivalSpeed="0.00"> <route edges="-101827901#1 -

101827901#0 101827882#1 101827889#2 101827889#3

101827896#4 27220838#9 337414907#0 337414907#1 -

117323137#0"/>
6
6
Macroscopic Simulation
Simulation is a model that mimics the operation of an existing or proposed system
To run the Simulation on SUMO the following inputs and command was used
The Network File (ABM.net.xml)
The Route Choice File (ABMTRIPS.rou.xml)

Using the standard Simulation SUMO command at the Command Prompt (CMD)

The out put (SUMO) shows the Performance of the network with number of
vehicles loaded and simulation

<sumo --net-file=ABM.net.xml--route-files=ABMTRIPS.rou.xml>

6
7
Macroscopic Simulation

Simulatio
n on
SUMO

6
8
Policy Changes

6
9
Policy Changes

Different policy change analysis can be done on


existing road networks to evaluate the effect of
the changes on trip generation characteristics.
Road expansion,
Bus rapid transit lane,
Speed policy change,
Road pricing,
Access management and
Traffic signalizing etc.
7
0
Access Management
Access management were done by closing vehicular access to part
of the study area as shown below.
Access is prevented on a market place and where there are high
numbers of vulnerable road users

7
1
Intersection Signalizing
Traffic signals were installed at three different intersections to assess
the change in trip generation.

7
2
Effects of Policy Changes

7
3
Effect of Intersection
Signalization
The introduction of signalized intersections on the existing road
network has created different changes in the traffic flow
characteristics.
Average trip duration: signalized intersection on the study area
has changed (increased) the trip duration by 15sec.

7
4
Effect of Intersection
Signalization
Average Trip Speed: the installation of signalized intersection has
reduced the average trip speed of vehicles by 2.5m/s.

7
5
Effect of Intersection
Signalization
Average Waiting Time: the waiting times of vehicles stuck at
traffic buildups.
The installation of signals has highly increased the average waiting
time of vehicles in the road network.

7
6
Effect of Intersection
Signalization
Running Vehicles: are vehicles that are either not fully stopped or
in motion but the engine is turn on.
Number of running vehicles after the signalization were greater

7
7
Effect of Intersection
Average Trip Time Loss:Signalization
the average travel/trip time lost by
vehicles when compared to the ideal travel time.
Signalization of the intersection on the study network increases the
average lost trip time

7
8
Effect of Access Management
The blocking of access to some roads around zone 1 has brought
some changes in the overall flow characteristic of the network.
Different flow characteristics like speed, duration, waiting time and
time loss are changed when the policy change is applied.

7
9
Number of Trips
(Before vs Access Management): the graph shows more realistic
positive and negative trip variations before policy change and access
management. Trip Difference (Before - Access Management)
350
315
300

250

200
159
150

100
65
33 43 29 21 34 42
50 20 10 4 13 8
0
0 1 2 3 4 5 6 -5
7 8 9 10 11 12 13 14-10
15 16 17-13
18 19 20-11
21 22 23
-50 -23 -21
-47 -46
-100
-96
-150
-127

8
0
Number of Trips
(Before vs Traffic Light): the graph shows more realistic positive
and negative trip variations before policy change and after
installation of traffic light.
Trip Difference (Before - Traffic Light)
150
136 140

100 90
77

50 40 41 45
33 29 31
19 22 20
5 11 1
11
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
-20 -15
-28 -31 -30
-50 -38 -40
8
1
Number of Trips

The policy changes has brought greater number of trips.

Total Number of Trips


78344
78300 78192
78100
77900 77795
77700
77500

e t t
g en h
g
an em Li
h c
C ag affi
i cy an T r
ol M
P ss
re e
o cc
ef A
B
8
2
Conclusion
SUMO is a very powerful tool for simulation and visualization of the real world traffic
flow characteristics.
It has an amazing ability to change Maps from Open Street Map to realistic, editable
and usable road networks.
The four stage modelling method exclude about 48.1% of the generated trip when
compared to the activity based method.
SUMO has made it possible to evaluate the effect of making policy changes on an
existing road networks in terms of:
Average Trip Duration
Average Trip speed
Average waiting time
Average speed
Running vehicle
Average trip time loss
Number of trips 8
3
Thank You !

8
4

You might also like