You are on page 1of 40

Example

9
Example: Following an individual traveller
1
Example: simulation of Berlin incl. PT 0

[[berlin-bvg09 ... works from intellij]]


1
Central ideas 1

"network loading" from computational physics


(molecular dynamics, cellular automata, queue model)
• → we knew already in 1991 that we could simulate 108 particles (= regions) microscopically

"evolutionary learning" from "complex adaptive systems"


(genetic algorithms, classifier systems, population-based algorithms, …)
• → Genotype ("Plan") vs phenotype (“execution of plan")
• → multiple plans per agent
• related to stochastic user equilibrium/discrete choice theory

"agents"
• agents (synthetic travellers, but e.g. also traffic signals) have internal state and make individual
decisions.
1
Project organization 2

Project is on github.com/matsim-org

Info at matsim.org

Core developers
• ETH Zurich
• Marcel Rieser (simunto ag)
• senozon
• us (= TU Berlin)
General design of the simulation system
initial
mobsim scoring analyses
demand

replanning
23
General design of simulation system
initial
mobsim scoring analyses
demand

replanning

Initial demand
= Synthetic persons with at least 1 plan/person
Mobsim
= mobility sim. = synth. reality = netw. loading = traff. flow sim.
Scoring
= each synthetic person obtains score (≈ utility value)
Replanning
Some agents change plans
Analyses
E.g. utility changes, emissions, accessibility, ...
Complete daily plans of synthetic travellers
initial
mobsim scoring analyses
demand

replanning
25
Activity plans
<person id="241">
<plan>
<act type="home" x="123.4" y="445.6" end=“07:00”/>
<act type="work" x="13.5" y="440.5" end=“12:00” />
<act type="lunch" ... end=“13:00”/>
<act type="work" ... end=“15:00”/>
<act type="doctor" ... duration=“2:00”/>
<act type="shop" ... duration=“1:00”/>
<act type="home" ... />
</plan>
</person>
...
27
Possible sources for initial plans (with or without mode; always w/o routes)
Travel diaries ... can be translated “as is”.
Activity-based demand generation ... can be translated “as is”.
Mobile phone data ... can be translated “as is” but needs additional work to extract modes and
activity types, and to correct for biases.
“Senozon” method:
1. generate synthetic population e.g. from census;
2. convert phone trajectories into plausible activity trajectories (given land use) and then throw
away locations (→ patterns)
3. extract 0/1 OD matrix from phone trajectories;
4. for each person in 1, select pattern from 2 and then locations from 3.
Synthetic generation by other means (similar to “senozon” method but without mobile phone
data) (synthetic population ➝ commuting matrix ➝ full activity chains ➝ possible calibration of
location choice against traffic counts)
• e.g. our Berlin model https://github.com/matsim-vsp/matsim-berlin
28
(Modes and) routes
<plan>
<act type="home" ... link="5834" end_time="07:00" />
<leg mode="car" trav_time="00:25">
<route>1932 1933 1934 1947</route>
</leg>
<act type="work" ... link="5844" end_time="16:00" />
<leg mode="car" trav_time="00:14">
<route>1934 1933</route>
</leg>
<act type="lunch" ... link="123" />
...
</plan>
...
29
For public transit, plan may look like this:
<act type="home" … link="31135" end_time="10:16:46" />
<leg mode=" walk" trav_time="00:10:34"> <route></route></leg>
<act type="pt interaction" … link="tr_9376" dur="00:00:00" />
<leg mode=" pt" trav_time="00:09:38">
<route> PT1===U9 </route>
</leg>
<act type="pt interaction" … link="tr_9381" dur="00:00:00" />
<leg mode=" walk" trav_time="00:02:00"> <route></route> </leg>
<act type="pt interaction" … link="tr_10332" dur="00:00:00" />
<leg mode=" pt" trav_time="00:02:51">
<route> PT1===S5 </route>
</leg>
. . .
<act type="work" … link="17723" />
. . .
Mobsim = mobility simulation
= traffic flow simulation = synthetic reality

initial
mobsim scoring analyses
demand

replanning
31
Mobsim
Mobsim: execute all plans simultaneously in a simulation of the physical world
⇒ Synthetic Reality
32
Mobsim
• Execute all plans simultaneously
• People, cars, buses, trains, airplanes, pedestrians, ...
• Also signals, tolls, ...
• Apart from that as simple as we could
think of.
• See next slide.

• Can obviously be made more detailed/


realistic ...(Gregor Lämmel)
33
Car traffic: "queue model"

Queue(ing) simulation. “Coupled hour glasses:"


• Vehicles drive with free speed until they hit end of queue;
• Queue is served in sequence of arrivals, corresponding to the flow capacity of the link (the traffic
signal);
• link can be full (➝ spillback).
34
Example with Bus (Andreas Neumann)
35
Protocol of Events [[m2_events]]
<event time="28680.0" type="arrival" person="passenger1" link="4077" legMode="walk" />
< ... "28680.0" ... "actstart" ... link="4077" activityType="pt interaction" />
< ... "28680.0" ... "actend" ... link="4077" … "pt interaction" />
< ... "28680.0" ... "departure" ... link="4077" legMode="pt" />
< ... "PersonEntersVehicle" ... vehicle="tr_0" transitRouteId="B-M44.101.901.H" />
< ... "PersonLeavesVehicle" ... vehicle="tr_0" transitRouteId="B-M44.101.901.H" />
< ... "30108.0" ... "arrival" ... link="3964b" legMode="pt" />
< ... "30108.0" ... "actstart" ... link="3964b"... "pt interaction" />
< ... "30138.0" ... "actend" ... link="3964b"... "pt interaction" />
< ... "30138.0" ... "departure" ... link="3964b" legMode="pt" />
< ... "PersonEntersVehicle" ... vehicle="tr_19" transitRouteId="B-344.101.901.H" />
< ... "PersonLeavesVehicle" ... vehicle="tr_19" transitRouteId="B-344.101.901.H" />
< ... "30945.0" ... "arrival" ... link="3891R" legMode="pt" />
< ... "30945.0" ... "actstart" ... link="3891R" act... "pt interaction" />
< ... "30946.0" ... "actend" ... link="3891R" act... "pt interaction" />
< ... "30946.0" ... "departure" ... link="3891R" legMode="walk" />
< ... "31066.0" ... "arrival" ... link="3889R" legMode="walk" />
< ... "31066.0" ... "actstart" ... link="3889R" act... "shopping" />
36
Modularity

Simulation of synthetic reality can be replaced; requirements:


• Execution of plans (incl. activities)
• Generation of “events”

Fairly straightforward; have done this multiple times; does not even have to be Java.
Scoring of executed plans
initial
mobsim scoring analyses
demand

replanning
40
Scoring of (executed) plans
Elements:
• Reward for performing activities
• Penalty for travel
• (Penalty for late arrival)
Sum up over day.

• Blue points = values that are summed up


• Marginal score identical at optimum (red lines)
Scoring, ctd

Use econometric "utility" for “score"


Vi = βtt.car * ttcar,i + βtt.pt * ttpt,i + βmoney * toll/farei + …
Random utility modelling: probai = exp(Vi) / ∑k exp(Vk)
Comes with method to estimate parameters based on real data (maximum likelihood estimation).
42
Scoring of plans

evolutionary computation:
fitness function

economics:
utility function
(→ benefit-cost-analysis)
Learning/Adaptation of synthetic travellers
initial
mobsim scoring analyses
demand

replanning
44
Learning/Adaptation

Some variant of:

1. Every synthetic traveller has one or more plans.

2. One (“selected”) plan per agent will be executed in the


mobsim, and scored.

3. Some agents generate/obtain new plans for themselves;


all others select between memorized plans.

4. Go to 2.
46
Agents have multiple plans
Plan Score

"start at home on link 123 → lv at 07:13 → take car → ar on link 120,3


345 for work → …"

"start at home on link 123 → lv at 07:03 → take subway → ar on 123,1


link 345 for work → …"

... ...

• Plan is description of intention ("genotype").


• Plans are executed in synthetic reality. This execution (gene expression, ”phenotype") is the
basis for the score.
47
Original plan
<plan>
<act type="home" ... link="5834" end_time="07:00" />
<leg mode="car" trav_time="00:25">
<route>1932 1933 1934 1947</route>
</leg>
<act type="work" ... link="5844" end_time="16:00" />
...
</plan>
48
New route
<plan>
<act type="home" ... link="5834" end_time="07:00" />
<leg mode="car" trav_time="00:25">
<route>1932 213 511 733 1947</route>
</leg>
<act type="work" ... link="5844" end_time="16:00" />
...
</plan>
49
New time
<plan>
<act type="home" ... link="5834" end_time="07:25" />
<leg mode="car" trav_time="00:25">
<route>1932 1933 1934 1947</route>
</leg>
<act type="work" ... link="5844" end_time="16:00" />
...
</plan>
50
New mode
<plan>
<act type="home" ... link="5834" end_time="07:00" />
<leg mode="pt" trav_time="00:25">
<route> ... </route>
</leg>
<act type="work" ... link="5844" end_time="16:00" />
...
</plan>
51
Adaptation of departure time
53
Lernen/Adaptation, Forts.
Ko-evolutionärer Algorithmus / Komplexes adaptives System / ...
(siehe W.B. Arthur, Inductive reasoning, bounded rationality, and the bar problem; Axelrod,
Evolution of cooperation)

Plan = Genotyp; Ausführung des Plans = Phenotyp

Adaptation kann sich auf beliebige Auswahldimensionen beziehen:


Routen, Verkehrsmittel, Zeiten, Aktivitätenorte, Aktivitätenmuster, ...

(geht damit weit über traditionelle Umlegung hinaus)


Validation
59
Hourly counts
Hourly counts on certain links

Comparison to simulation

google earth
(runs-svn/berlin-base-case-run791/output_rerun/ITERS/it.600)
6
Comparison to traditional 4 step process 0

Few “objective” comparisons

I would say:
For 24 hours counts MATSim is about similar (i.e. neither better nor worse).
But MATSim more expressive = sensitivity to policy measures where 4 step not applicable, e.g.
• everything that is time dependent (time dep toll, changes of opening times, cold start emissions,
...)
• everything that has hard constraints (day has 24 hours, vehicles in families/in car sharing are
limited, ...)
• Newer examples: discharging profiles of electric vehicles, autonomous vehicles, “mobility on
demand”
Downstream analysis
initial
mobsim scoring analyses
demand

replanning
64
Anwendungsbeispiele

• Siehe “A100" früher in VL.

• Einige Beispiele bei "statischer Umlegung" waren tatsächlich mit MATSim gerechnet → alles,
was der 4-Stufen-Prozess kann, kann der agentenbasierte (= mikroskopische und
verhaltensbasierte) Ansatz auch.
97
Some URLs
Questions to the MATSim community
• matsim.org/faq

MATSim book
• matsim.org/the-book

User guide
• matsim.org/docs/userguide
• Effectively an extract from the above MATSim book.
• Material for next couple of weeks.
• Do not print ahead of time: will update along with class.

You might also like