Sunteți pe pagina 1din 27

Integrated Modelling with

Emme using Python: The


TMG Experience
June 27, 2014

Peter Kucirek, M.A.Sc.

Outline
1.

About TMG

2.

Converting Macros to Tools

3.

Integrating GIS with Emme

4.

Integrating Emme with XTMF

5.

Discussion / Questions

About TMG

What is TMG?

TMG = Travel Modelling Group

Research group within UTTRI (University of Toronto


Transportation Institute)

Supported by government partners:

MTO

City of Mississauga

Metrolinx

City of Brampton

City of Toronto

Region of Halton

Region of Durham

City of Hamilton

Region of York

Region of Peel
4

What does TMG do?


The primary role of the TMG is to facilitate the
development of common methods, tools, and techniques
pertaining to transportation demand modelling and
analysis, and to aid in the application and advancement of
modelling and analytics in transportation planning.
- TMG Terms of Reference Document June 2014

Four main areas of interest:


1.

Research, development, and testing of innovative


modelling techniques for the simulation and analysis of a
wide range of policy areas of interest.

2.

Development of software and tools to implement and


support modelling techniques

3.

Consolidation of common data to support modelling.

4.

Training and outreach

This is where Emme comes in


5

Specific TMG Projects

Development of Network Coding Standard 11 (NCS11)

Develoment of multi-time-period 2012 base Emme


network

Translation of existing Emme Macros to new Python Tool


format

Development of automated network editing procedures

Development of new assignment and analysis


procedures

Software development (all open-source):

XTMF

TMG Toolbox for Emme Python

Converting Macros to Tools

Why convert macros?

Improved, mouse-based user interface

Better error-checking and catching of common user


mistakes (and ability to check these mistakes early!)

Network API support allows direct access to network


topology for automated editing

Opportunities to improve performance, e.g. using numpy

Ability to easily integrate with other data formats (ESRI


shapefiles, XML, CSV, etc.)

Ability to write scripts inside of existing IDEs (such as


Eclipse, Wing, etc.), which often include sub-version
support for better code management
Also debugging!

In my opinion, Python tools are much easier to read and


write than Emme macros
8

Result: User Interface

Result: User Interface

10

Result: Code maintenance

11

Result: Code maintenance

12

Integrating GIS with Emme

15

How to use GIS tools through


Emme Python

shapely is an open-source Python library installed with


Emme 4

shapely supports a wide variety of geometric


operations:

Intersection testing (contains, touches, etc.)

Set-theoretic (union, subtraction, etc.) of polygons

Buffering / offset

Linear projection

TMG developed a class to facilitate conversion to/from


ESRI shapefiles from/to shaplely geometries
16

Examples of usage

Generation of an adjancency matrix for TAZs using their


actul geometry

Saving the shapes of incompatible centroid connectors


when copying from one project to another

Load network attributes from shapefiles

Load transit fare zones from shapefiles (when


generating fare-based transit networks)

17

Case Study: CCGEN


Objective: To develop a tool for generating centroid
connectors for a given network and zone centroids.
One strong constraint provided by our users was that the
tool should prevent connectors from crossing physical
boundaries (e.g. rivers, highways, railways)
Tool also needs to determine which nodes are within a
zones boundary

18

Case Study: CCGEN

ZONE CENTROID

19

Case Study: CCGEN

ZONE CENTROID

20

Case Study: CCGEN

ZONE CENTROID

21

Case Study: CCGEN

Node de-selected due to


boundary crossing
restriction

ZONE CENTROID

22

Integrating Emme with


XTMF

23

What is XTMF?

XTMF = eXtensible Travel Modelling Framework

Written in C# for the .NET framework / Mono


(Linux/Mac)

Designed to be a platform for modular models

Open-source license using GPLv3

Currently implemented in XTMF:

TASHA

Durham Region Model

GTAModel V2 (City of Toronto)

GTAModel V4.0

ILUTE
24

How does XTMF interface


with Emme?
XTMF
ModellerController.cs

Python
ModellerBridge.py
inro.emme.modeller.Modeller()

EMME

25

Case Study: Parameter


Estimation
Objective: To calibrate a new transit assignment procedure
for GTAModel V4.0. The first step was to estimate
parameter values using XTMF.
Process: XTMF has a generalized framework for estimating
model parameters using several algorithms (gradient
descent, particle swarm, etc.), and support for distributed
computing.

For an estimation run, we would launch 8 Emme


processes on each of 4 computers and run transit
assignment 1,000+ times
26

27

Case Study: Parameter


Estimation

RMSE of AM Transit Line Boardings

Learning Curve
1100
1050
1000
950
900
850
800
750
700
650
600
550
500

14

21

28

35
42
Iteration

49

56

63

70

28

Questions?

29

S-ar putea să vă placă și