MATSim Tutorial, May 17-19 2010,ETH Zurich
Generating Demand and Supply
P
t 2
Part 2:
Initial demand generation
F. Ciari IVT-ETH Zurich
C. Dobler IVT-ETH Zurich
Scope of this Tutorial
Having an idea, which type of data is necessary to build an own
scenario and where to get the data
Knowing the entry points in the software to create a synthetic
population and the associated travel demand
MATSim Data Structures
Population A 1 1 Act 1 Leg 1 Act 2 Leg 2 2Person (Agent) Plan 1
Plan 2 Plan 3 Leg 2
…
Leg n-1 3…
Plan n Act n…
Relevant Java Classes:Person, PersonImpl n Plan, PlanImpl Act, ActImpl Leg, LegImpl Leg, LegImpl
Generating the Demand: Population and Initial Plans
<personid="103" sex="f"age="25" license="no" car_avail="never" employed="yes"> <planselected="yes">
<acttype="home" link="110" facility="1"x="60.0"y="110.0"start_time="00:00:00" dur="08:43:35"
end_time="08:43:35" />
l "0" d " " d i "08 43 3 " i "00 00 00" i "08 43 3 "
<legnum="0" mode="car" dep_time="08:43:35" trav_time="00:00:00" arr_time="08:43:35"> </leg>
<acttype="work" link="104" facility="2" x="310.0"y="70.0" start_time="08:43:35" dur="06:00:00"
end_time="14:43:35" />
l "1" d " " d ti "14 43 35" t ti "00 00 00" ti "14 43 35"
<legnum="1" mode="car" dep_time="14:43:35" trav_time="00:00:00" arr_time="14:43:35"> </leg>
<acttype="leisure" link="107" facility="9"x="250.0"y="270.0" start_time="14:43:35" dur="06:00:00"
end_time="20:43:35" />
l "2" d " " d ti "20 43 35" t ti "00 00 00" ti "20 43 35"
<legnum="2" mode="car" dep_time="20:43:35" trav_time="00:00:00" arr_time="20:43:35"
</leg>
<acttype="home" link="110" facility="1"x="60.0"y="110.0"start_time="20:43:35" dur="03:16:25"
end_time="24:00:00" /> / l
</plan>
Generating the Demand: Population and Initial Plans
<personid=„???" sex=„???" age=„???" license=„???" car_avail=„???" employed=„???"> <planselected="yes">
<acttype=„???" link=„???" facility=„???" x=„???" y=„???" start_time=„???" dur=„???"
end_time=„???" />
l ???" d ???" d i ???" i ???" i ???"
<legnum=„???" mode=„???" dep_time=„???"trav_time=„???" arr_time=„???"> </leg>
<acttype=„???" link=„???" facility=„???" x=„???" y=„???" start_time=„???" dur=„???"
end_time=„???" />
l ???" d ???" d ti ???"t ti ???" ti ???"
<legnum=„???" mode=„???" dep_time=„???"trav_time=„???" arr_time=„???"> </leg>
<acttype=„???" link=„???" facility=„???" x=„???" y=„???" start_time=„???" dur=„???"
end_time=„???" />
l ???" d ???" d ti ???"t ti ???" ti ???"
<legnum=„???" mode=„???" dep_time=„???"trav_time=„???" arr_time=„???"> </leg>
<acttype=„???" link=„???" facility=„?"x=„???" y=„???" start_time=„???"dur=„???„
end_time=„???" /> / l
</plan>
Which kind of data do I need? – Persons (Population)
Which kind of data do I need? – Persons (Population)
Which kind of data do I need? – Persons (Population)
Population
Æ
Population Census
Æ
Personal data (Age, Gender,
Employment, etc.)
Generating the Demand: Population and Initial Plans
<personid=„???" sex=„???" age=„???" license=„???" car_avail=„???" employed=„???"> <planselected="yes">
<acttype=„???" link=„???" facility=„???" x=„???" y=„???" start_time=„???" dur=„???"
end_time=„???" />
<legnum= ???"mode= ???" dep time= ???"trav time= ???" arr time= ???"> <legnum=„??? mode=„??? dep_time=„??? trav_time=„??? arr_time=„??? > </leg>
<acttype=„???" link=„???" facility=„???" x=„???" y=„???" start_time=„???" dur=„???"
end_time=„???" />
<legnum= ???"mode= ???" dep time= ???"trav time= ???" arr time= ???"> <legnum=„??? mode=„??? dep_time=„??? trav_time=„??? arr_time=„??? > </leg>
<acttype=„???" link=„???" facility=„???" x=„???" y=„???" start_time=„???" dur=„???"
end_time=„???" />
<legnum= ???"mode= ???" dep time= ???"trav time= ???" arr time= ???"> <legnum=„??? mode=„??? dep_time=„??? trav_time=„??? arr_time=„??? > </leg>
<acttype=„???" link=„???" facility=„?"x=„???" y=„???" start_time=„???"dur=„???„
end_time=„???" /> </plan>
</plan>
Generating the Demand: Population and Initial Plans
<personid=„103" sex=„f" age=„25"license=„???" car_avail=„???" employed=„yes"> <planselected="yes">
<acttype=„???" link=„???" facility=„???" x=„???" y=„???" start_time=„???"dur=„???"
end_time=„???" />
<legnum= ???"mode= ???" dep time= ???" trav time= ???" arr time= ???"> <legnum=„??? mode=„??? dep_time=„??? trav_time=„??? arr_time=„??? > </leg>
<acttype=„???" link=„???" facility=„???" x=„???" y=„???" start_time=„???"dur=„???"
end_time=„???" />
<legnum= ???"mode= ???" dep time= ???" trav time= ???" arr time= ???"> <legnum=„??? mode=„??? dep_time=„??? trav_time=„??? arr_time=„??? > </leg>
<acttype=„???" link=„???" facility=„???" x=„???" y=„???" start_time=„???"dur=„???"
end_time=„???" />
<legnum= ???"mode= ???" dep time= ???" trav time= ???" arr time= ???"> <legnum „??? mode „??? dep_time „??? trav_time „??? arr_time „??? > </leg>
<acttype=„???" link=„???" facility=„?"x=„???" y=„???" start_time=„???" dur=„???„
end_time=„???" /> </plan>
</plan>
Which kind of data do I need? - Activities
Population
Æ
Population Census
Æ
Personal data (Age, Gender,
Employment, etc.)
Which kind of data do I need? - Activities
Population
Æ
Population Census
Æ
Personal data (Age, Gender,
Employment, etc.)
Which kind of data do I need? - Activities
Population
Æ
Population Census
Æ
Personal data (Age, Gender,
Employment, etc.)
Activities
Æ
Mobility census
y
Æ
Where, when and why persons are
,
y p
traveling
Generating the Demand: Population and Initial Plans
<personid=„103" sex=„f" age=„25"license=„???" car_avail=„???" employed=„yes"> <planselected="yes">
<acttype=„???" link=„???" facility=„???" x=„???" y=„???" start_time=„???" dur=„???"
end_time=„???" />
<leggnum=„„???" mode=„???"„ dep timep_ =„„???"trav time_ =„„???" arr time_ =„???"„ > </leg>
<acttype=„???" link=„???" facility=„???" x=„???" y=„???" start_time=„???" dur=„???"
end_time=„???" />
<leggnum=„„???" mode=„???"„ dep timep_ =„„???"trav time_ =„„???" arr time_ =„???"„ > </leg>
<acttype=„???" link=„???" facility=„???" x=„???" y=„???" start_time=„???" dur=„???"
end_time=„???" />
<leggnum=„„???" mode=„???"„ dep_timep_ =„„???"trav_time_ =„„???" arr_time_ =„???"„ > </leg>
<acttype=„???" link=„???" facility=„?"x=„???" y=„???" start_time=„???"dur=„???„
end_time=„???" /> </planp >
Generating the Demand: Population and Initial Plans
<personid="103" sex="f"age="25" license="no" car_avail="???"employed="yes"> <planselected="yes">
<acttype="home" link=„???" facility=„???" x="60.0"y="110.0"start_time="00:00:00"dur="08:43:35"
end_time="08:43:35" />
<leggnum="0" mode=„???"„ dep timep_ ="08:43:35" trav time_ ="00:00:00" arr time_ ="08:43:35"> </leg>
<acttype="work" link=„???" facility=„???" x="310.0" y="70.0" start_time="08:43:35" dur="06:00:00"
end_time="14:43:35" />
<leggnum="1" mode=„???"„ dep timep_ ="14:43:35" trav time_ ="00:00:00" arr time_ ="14:43:35"> </leg>
<acttype="leisure" link =„???" facility =„???" x="250.0" y="270.0" start_time="14:43:35"
dur="06:00:00" end_time="20:43:35"/>
<leggnum="2" mode =„???"„ dep_timep_ ="20:43:35" trav_time_ ="00:00:00" arr_time_ ="20:43:35"
</leg>
<acttype="home" link =„???" facility =„???" x="60.0" y="110.0" start_time="20:43:35"
dur="03:16:25" end_time="24:00:00"/> </planp >
Which kind of data do I need? – Mobility Behavior
Population
Æ
Population Census
Æ
Personal data (Age, Gender,
Employment, etc.)
Activities
Æ
Mobility census
y
Æ
Where, when and why persons are
,
y p
traveling
Mobility Behavior?
Mobility Behavior?
Which kind of data do I need? – Mobility Behavior
Population
Æ
Population Census
Æ
Personal data (Age, Gender,
Employment, etc.)
Activities
Æ
Mobility census
y
Æ
Where, when and why persons are
,
y p
traveling
Mobility Behavior
Æ
Mobility census
Mobility Behavior
Æ
Mobility census
Which kind of data do I need? – Mobility Behavior
Population
Æ
Population Census
Æ
Personal data (Age, Gender,
Employment, etc.)
Activities
Æ
Mobility census
y
Æ
Where, when and why persons are
,
y p
traveling
Mobility Behavior
Æ
Mobility census
Æ
Mobility Tools availability Mode
Mobility Behavior
Æ
Mobility census
Æ
Mobility Tools availability, Mode
choice
Generating the Demand: Population and Initial Plans
<personid="103" sex="f"age="25" license="no" car_avail="???"employed="yes"> <planselected="yes">
<acttype="home" link=„???" facility=„???" x="60.0"y="110.0"start_time="00:00:00"dur="08:43:35"
end_time="08:43:35" />
<leggnum="0" mode=„???"„ dep timep_ ="08:43:35" trav time_ ="00:00:00" arr time_ ="08:43:35"> </leg>
<acttype="work" link=„???" facility=„???" x="310.0" y="70.0" start_time="08:43:35" dur="06:00:00"
end_time="14:43:35" />
<leggnum="1" mode=„???"„ dep timep_ ="14:43:35" trav time_ ="00:00:00" arr time_ ="14:43:35"> </leg>
<acttype="leisure" link =„???" facility =„???" x="250.0" y="270.0" start_time="14:43:35"
dur="06:00:00" end_time="20:43:35"/>
<leggnum="2" mode =„???"„ dep_timep_ ="20:43:35" trav_time_ ="00:00:00" arr_time_ ="20:43:35"
</leg>
<acttype="home" link =„???" facility =„???" x="60.0" y="110.0" start_time="20:43:35"
dur="03:16:25" end_time="24:00:00"/> </planp >
Generating the Demand: Population and Initial Plans
<personid="103" sex="f"age="25" license="no" car_avail=„yes" employed="yes"> <planselected="yes">
<acttype="home" link=„???" facility=„???" x="60.0"y="110.0"start_time="00:00:00"dur="08:43:35"
end_time="08:43:35" />
<leggnum="0" mode=„car"„ dep timep_ ="08:43:35" trav time_ ="00:00:00"arr time_ ="08:43:35"> </leg>
<acttype="work" link=„???" facility=„???" x="310.0" y="70.0" start_time="08:43:35" dur="06:00:00"
end_time="14:43:35" />
<leggnum="1" mode=„car"„ dep timep_ ="14:43:35" trav time_ ="00:00:00"arr time_ ="14:43:35"> </leg>
<acttype="leisure" link =„???" facility =„???" x="250.0" y="270.0" start_time="14:43:35"
dur="06:00:00" end_time="20:43:35"/>
<leggnum="2" mode =„car"„ dep_timep_ ="20:43:35" trav_time_ ="00:00:00" arr_time_ ="20:43:35"
</leg>
<acttype="home" link =„???" facility =„???" x="60.0" y="110.0" start_time="20:43:35"
dur="03:16:25" end_time="24:00:00"/> </planp >
Which kind of data do I need? - Facilities
Population
Æ
Population Census
Æ
Personal data (Age, Gender,
Employment, etc.)
Activities
Æ
Mobility census
y
Æ
Where, when and why persons are
,
y p
traveling
Mobility Behavior
Æ
Mobility census
Æ
Mobility Tools availability Mode
Mobility Behavior
Æ
Mobility census
Æ
Mobility Tools availability, Mode
choice
Facilities?
Facilities?
Which kind of data do I need? - Facilities
Population
Æ
Population Census
Æ
Personal data (Age, Gender,
Employment, etc.)
Activities
Æ
Mobility census
y
Æ
Where, when and why persons are
,
y p
traveling
Mobility Behavior
Æ
Mobility census
Æ
Mobility Tools availability Mode
Mobility Behavior
Æ
Mobility census
Æ
Mobility Tools availability, Mode
choice
Facilities
Æ
Population Census + Enterprises Census
Facilities
Æ
Population Census + Enterprises Census
Which kind of data do I need? - Facilities
Population
Æ
Population Census
Æ
Personal data (Age, Gender,
Employment, etc.)
Activities
Æ
Mobility census
y
Æ
Where, when and why persons are
,
y p
traveling
Mobility Behavior
Æ
Mobility census
Æ
Mobility Tools availability Mode
Mobility Behavior
Æ
Mobility census
Æ
Mobility Tools availability, Mode
choice
Facilities
Æ
Population Census + Enterprises Census
Æ
Location of
Facilities
Æ
Population Census + Enterprises Census
Æ
Location of
facilities (Home, Work, Education, Shop, Leisure)
Generating the Demand: Population and Initial Plans
<personid="103" sex="f"age="25" license="no" car_avail=„yes" employed="yes"> <planselected="yes">
<acttype="home" link=„???" facility=„???" x="60.0"y="110.0"start_time="00:00:00"dur="08:43:35"
end_time="08:43:35" />
<leggnum="0" mode=„car"„ dep timep_ ="08:43:35" trav time_ ="00:00:00"arr time_ ="08:43:35"> </leg>
<acttype="work" link=„???" facility=„???" x="310.0" y="70.0" start_time="08:43:35" dur="06:00:00"
end_time="14:43:35" />
<leggnum="1" mode=„car"„ dep timep_ ="14:43:35" trav time_ ="00:00:00"arr time_ ="14:43:35"> </leg>
<acttype="leisure" link =„???" facility =„???" x="250.0" y="270.0" start_time="14:43:35"
dur="06:00:00" end_time="20:43:35"/>
<leggnum="2" mode =„car"„ dep_timep_ ="20:43:35" trav_time_ ="00:00:00" arr_time_ ="20:43:35"
</leg>
<acttype="home" link =„???" facility =„???" x="60.0" y="110.0" start_time="20:43:35"
dur="03:16:25" end_time="24:00:00"/> </planp >
Generating the Demand: Population and Initial Plans
<personid="103" sex="f"age="25" license="no" car_avail=„yes" employed="yes"> <planselected="yes">
<acttype="home" link=„???" facility=„1"x="60.0" y="110.0" start_time="00:00:00" dur="08:43:35"
end_time="08:43:35" />
<leggnum="0" mode=„car"„ dep timep_ ="08:43:35" trav time_ ="00:00:00"arr time_ ="08:43:35"> </leg>
<acttype="work" link=„???" facility=„2"x="310.0" y="70.0"start_time="08:43:35" dur="06:00:00"
end_time="14:43:35" />
<leggnum="1" mode=„car"„ dep timep_ ="14:43:35" trav time_ ="00:00:00"arr time_ ="14:43:35"> </leg>
<acttype="leisure" link =„???" facility =„9" x="250.0" y="270.0"start_time="14:43:35"
dur="06:00:00" end_time="20:43:35"/>
<leggnum="2" mode =„car"„ dep_timep_ ="20:43:35" trav_time_ ="00:00:00" arr_time_ ="20:43:35"
</leg>
<acttype="home" link =„???" facility =„1" x="60.0"y="110.0" start_time="20:43:35" dur="03:16:25"
end_time="24:00:00" /> </planp >
Which kind of data do I need? - Network
Population
Æ
Population Census
Æ
Personal data (Age, Gender,
Employment, etc.)
Activities
Æ
Mobility census
y
Æ
Where, when and why persons are
,
y p
traveling
Mobility Behavior
Æ
Mobility census
Æ
Mobility Tools availability Mode
Mobility Behavior
Æ
Mobility census
Æ
Mobility Tools availability, Mode
choice
Facilities
Æ
Population Census + Enterprises Census
Æ
Location of
Facilities
Æ
Population Census + Enterprises Census
Æ
Location of
facilities (Home, Work, Education, Shop, Leisure)
Which kind of data do I need? - Network
Population
Æ
Population Census
Æ
Personal data (Age, Gender,
Employment, etc.)
Activities
Æ
Mobility census
y
Æ
Where, when and why persons are
,
y p
traveling
Mobility Behavior
Æ
Mobility census
Æ
Mobility Tools availability Mode
Mobility Behavior
Æ
Mobility census
Æ
Mobility Tools availability, Mode
choice
Facilities
Æ
Population Census + Enterprises Census
Æ
Location of
Facilities
Æ
Population Census + Enterprises Census
Æ
Location of
facilities (Home, Work, Education, Shop, Leisure)
(N t
k
Æ
G
d d R
d N t
k
Æ
R
d
t
k)
(Network
Æ
Geocoded Road Network
Æ
Road network)
Generating the Demand: Population and Initial Plans
<personid="103" sex="f"age="25" license="no" car_avail=„yes" employed="yes"> <planselected="yes">
<acttype="home" link=„107" facility=„1"x="60.0" y="110.0" start_time="00:00:00" dur="08:43:35"
end_time="08:43:35" />
<legnum="0" mode= car" dep time="08:43:35" trav time="00:00:00"arr time="08:43:35"> <legnum= 0 mode=„car dep_time= 08:43:35 trav_time= 00:00:00 arr_time= 08:43:35 > </leg>
<acttype="work" link=„105" facility=„2"x="310.0" y="70.0"start_time="08:43:35" dur="06:00:00"
end_time="14:43:35" />
<legnum="1" mode= car" dep time="14:43:35" trav time="00:00:00"arr time="14:43:35"> <legnum= 1 mode=„car dep_time= 14:43:35 trav_time= 00:00:00 arr_time= 14:43:35 > </leg>
<acttype="leisure" link =„101" facility =„9" x="250.0" y="270.0"start_time="14:43:35"
dur="06:00:00" end_time="20:43:35"/>
<legnum="2" mode= car"dep time="20:43:35" trav time="00:00:00" arr time="20:43:35"
<legnum= 2 mode =„car dep_time= 20:43:35 trav_time= 00:00:00 arr_time= 20:43:35
</leg>
<acttype="home" link =„107" facility =„1" x="60.0"y="110.0" start_time="20:43:35" dur="03:16:25"
end_time="24:00:00" /> </plan>
</plan>
Generating the Demand: Population and Initial Plans
<personid="103" sex="f"age="25" license="no" car_avail=„yes" employed="yes"> <planselected="yes">
<acttype="home" link=„107" facility=„1"x="60.0" y="110.0" start_time="00:00:00" dur="08:43:35"
end_time="08:43:35" />
<legnum="0" mode= car" dep time="08:43:35" trav time="00:00:00"arr time="08:43:35"> <legnum= 0 mode=„car dep_time= 08:43:35 trav_time= 00:00:00 arr_time= 08:43:35 > </leg>
<acttype="work" link=„105" facility=„2"x="310.0" y="70.0"start_time="08:43:35" dur="06:00:00"
end_time="14:43:35" />
<legnum="1" mode= car" dep time="14:43:35" trav time="00:00:00"arr time="14:43:35"> <legnum= 1 mode=„car dep_time= 14:43:35 trav_time= 00:00:00 arr_time= 14:43:35 > </leg>
<acttype="leisure" link =„101" facility =„9" x="250.0" y="270.0"start_time="14:43:35"
dur="06:00:00" end_time="20:43:35"/>
<legnum="2" mode= car"dep time="20:43:35" trav time="00:00:00" arr time="20:43:35"
<legnum= 2 mode =„car dep_time= 20:43:35 trav_time= 00:00:00 arr_time= 20:43:35
</leg>
<acttype="home" link =„107" facility =„1" x="60.0"y="110.0" start_time="20:43:35" dur="03:16:25"
end_time="24:00:00" /> </plan>
</plan>
Which kind of data do I need? - Resuming
Population Census
Mobility census
Enterprises Census
Geocoded road Network (OpenStreetMap Teleatlas Navteq Google etc )
Geocoded road Network (OpenStreetMap, Teleatlas, Navteq, Google, etc.)
Were is this data coming from?
Population Census
Æ
BfS (Federal Statistics Office)
(
www.bfs.admin.ch/bfs/portal/en/index/infothek/erhebungen__quellen/blank/blank/vz
/uebersicht.html
)
Mobility census
Æ
BfS
(
www.bfs.admin.ch/bfs/portal/de/index/themen/11/07/01/02/01.html
)
Enterprises Census
Æ
BfS
(
www.bfs.admin.ch/bfs/portal/en/index/infothek/erhebungen__quellen/blank/blank/bz
/01 html
)
/01.html
)
Geocoded road Network
Æ
Teleatlas Network
(
)
(
)
Initial Demand Generation - Conclusions
The generation of the initial demand is a very important task for the
The generation of the initial demand is a very important task for the
correct functioning of MATSim and may take a substantial
amount of time (weeks or even months)
Two are the main challenges:
- To gather all the necessary data (many different data sets,
To gather all the necessary data (many different data sets,
high resolution)
- To put the information together in a meaningful way (different
dimension different resolution)
Initial Demand Generation – Let‘s work!
Download and open files:
Tutorial homepage - http://matsim.org/node/409 • input_files_demandgeneration_tutorial.zip
• Config files
• Input sample (input_sample_zurich.txt)
• Variables description (variables_description.txt)
• Create folder and extract files to matsim/examples/tutorial/demandgeneration • src_files_demandgeneration_tutorial.zip
• Java source files
• Create package and extract files to matsim/src/usermeeting/demandgeneration • Edit PopulationCreator class