Skip to content

MATSim: Large-Scale Agent-Based Transport Demand Modeling for Metropolitan Networks

By Jeff 65 views
MATSim multi-agent transport simulation visualization showing vehicle flows across a metropolitan road network
MATSim multi-agent transport simulation visualization showing vehicle flows across a metropolitan road network

MATSim (Multi-Agent Transport Simulation) is an open-source framework developed through a collaboration between ETH Zurich and TU Berlin that enables transportation planners and researchers to simulate the daily travel behavior of millions of individual agents across entire metropolitan regions. Unlike mesoscopic or macroscopic traffic models that aggregate flows, MATSim operates at the individual-agent level, capturing the emergent congestion patterns and mode-choice dynamics that arise from the interaction of thousands or millions of synthetic travelers simultaneously pursuing their daily activity schedules.

The Co-Evolutionary Core: Plans and Scoring

At the heart of MATSim is a co-evolutionary optimization loop that distinguishes it from conventional assignment models. Each agent maintains a portfolio of daily activity plans — sequences of activities (home, work, shopping, leisure) connected by travel legs with specified modes and routes. The simulation iterates through three phases:

  1. Mobsim (Mobility Simulation): All agents execute their current selected plan simultaneously on the network. MATSim's default queue-based traffic flow model (QSim) propagates vehicles through links using a simplified kinematic wave approach, enabling city-scale runs with millions of agents in minutes rather than hours.

  2. Scoring: Each agent's executed plan receives a utility score based on the Charypar-Nagel utility function, which rewards time spent performing activities and penalizes travel time, monetary costs, and late arrivals. The scoring parameters are empirically calibrated against observed travel survey data.

  3. Replanning: A configurable fraction of agents (typically 10–20%) modify their plans — changing departure times, routes, or modes — using built-in or custom strategy modules. Over 100–200 iterations, the population converges toward a stochastic user equilibrium.

This approach naturally handles peak spreading: agents who consistently experience congestion during the morning peak will shift departure times earlier or later, reproducing the empirically observed flattening of peak demand without requiring explicit demand-side constraints.

MATSim simulation interface showing agent activity plans and network performance metrics

Demand Generation with Population Synthesis

A critical prerequisite for any MATSim scenario is a synthetic population that statistically mirrors the real demographic and spatial distribution of the study area. The standard workflow involves:

  • Census microdata fusion: Combining household travel surveys with census marginal distributions using iterative proportional fitting (IPF) to generate a synthetic population with realistic socioeconomic attributes.
  • Activity chain assignment: Matching synthetic agents to observed activity patterns from travel diaries, preserving correlations between trip purpose, time-of-day, and socioeconomic group.
  • Facility sampling: Assigning specific activity locations (workplaces, schools, shops) from OpenStreetMap or land-use databases using gravity-model or discrete-choice destination samplers.

Tools such as eqasim (developed at EPFL) and the MATSim Open Berlin Scenario provide ready-to-use population synthesis pipelines that dramatically reduce scenario setup time for new study areas.

Multi-Modal Network Representation

MATSim supports heterogeneous modal networks within a single simulation:

Mode Network Representation Key Parameters
Private car Road network links with capacity, free-flow speed Flow capacity (veh/h), storage capacity
Public transit Schedule-based transit (GTFS import) Headways, dwell times, vehicle capacities
Cycling Dedicated infrastructure links Speed distributions, infrastructure type
Walking Pedestrian links or teleportation Speed, maximum distance
Ride-hailing / DRT Dynamic dispatch via DVRP extension Fleet size, service area, pricing

The pt2matsim tool converts GTFS feeds directly into MATSim transit schedules, enabling rapid integration of real-world public transport timetables. Agents can chain modes within a single trip (e.g., walk → bus → metro → walk), with transfers modeled explicitly at interchange nodes.

Agent-based multimodal transport network diagram illustrating mode-choice interactions

Practical Application: Evaluating a New BRT Corridor

A typical MATSim policy analysis workflow for a proposed Bus Rapid Transit (BRT) corridor proceeds as follows:

  1. Baseline calibration: Run the existing network scenario and validate simulated link volumes against traffic counts (GEH statistic < 5 for ≥ 85% of count stations) and transit ridership against AFC data.
  2. Scenario construction: Add the BRT corridor to the transit schedule with revised headways, dedicated lane capacity, and updated fare structure.
  3. Comparative run: Execute 150 iterations of the BRT scenario; agents with access to the new corridor will adopt it if the utility gain exceeds the switching cost.
  4. Output analysis: Compare mode shares, vehicle-kilometers traveled (VKT), average travel times by origin-destination pair, and link-level volume changes using MATSim's built-in analysis modules or the via visualization tool.

This workflow can reveal second-order effects invisible to static assignment models — for example, induced demand from car users switching to BRT, or redistribution of congestion to parallel corridors as road capacity is reallocated to bus lanes.

BRT corridor simulation output map showing demand redistribution and ridership patterns

Scalability and Computational Performance

MATSim's QSim is parallelized across CPU cores using a thread-per-link architecture. Benchmark results from published scenarios:

  • Île-de-France (12 million agents): ~45 minutes per iteration on a 32-core server
  • Switzerland national scenario (8 million agents): ~30 minutes per iteration
  • Berlin (5 million agents): ~15 minutes per iteration

For scenarios requiring higher spatial fidelity, MATSim integrates with SUMO via the TraCI interface, allowing selected sub-networks to be simulated microscopically while the remainder of the city runs in MATSim's queue model — a hybrid approach that balances computational cost against behavioral detail.

Extensions and the MATSim Ecosystem

MATSim's modular contribution (contribs) architecture allows domain-specific extensions without modifying the core:

  • DVRP / AMoDeus: Autonomous mobility-on-demand fleet simulation with rebalancing algorithms
  • Freight: Commercial vehicle tour planning integrated with agent-based demand
  • Emissions: Link-level emission factors (HBEFA database) for air quality impact assessment
  • Noise: Propagation-based noise exposure mapping for environmental impact studies
  • Bicycle: Detailed cycling infrastructure modeling with gradient and surface effects

Getting Started

MATSim is freely available under the GNU General Public License v2. The recommended entry point for new users is the MATSim Open Berlin Scenario, which provides a fully calibrated 5-million-agent scenario with documented setup instructions.

For organizations evaluating MATSim for regional transport planning, the senozon company (founded by core MATSim developers) offers commercial support, scenario development services, and the Via post-processing and visualization platform.

Conclusion

MATSim occupies a unique position in the transportation simulation landscape: it is the only widely adopted open-source framework capable of simulating the full daily activity-travel behavior of an entire metropolitan population at the individual-agent level. Its co-evolutionary equilibration mechanism, multi-modal network support, and rich extension ecosystem make it particularly well-suited for evaluating demand-side interventions — congestion pricing, mobility-as-a-service integration, autonomous vehicle fleet deployment — where the behavioral response of the traveling population is as important as the supply-side network changes. For transportation planners and researchers working at the regional scale, MATSim represents a powerful complement to microscopic tools like PTV Vissim or SUMO, providing the population-level behavioral dynamics that link-level models cannot capture.

Tags: MATSim agent-based simulation transport demand modeling multi-modal networks traffic simulation