Sebastian Hörl

28 September 2026

MATSim User Meeting 2026

Benchmarking on-demand mobility algorithms using a new
remote dispatching interface for MATSim

Introduction

  • MATSim provides the DRT / DVRP packages that allow simulating on-demand mobility services
     
  • As standalone simulations (given fixed trips) or as part of the whole loop (agent deciding for DRT)

Fleet dispatching

  • Fleet dispatching means defining which vehicle should pick up and drop off which requests and in which order

  • Assignments need to adhere to constraints (latest pickup time, latest dropoff time, maximum detour, ...)
     
  • DRT Algorithm
    Default implementation in MATSim
    Myopic insertion heuristic
     
  • Alonso-Mora
    Overrides default implementation
    Dynamic reconstruction of schedules

Idea

  • Let's flexibilize the way we can hook dispatching algorithms into MATSim!
     
  • Rapid development using Python and other languages
  • Reuse of existing libraries (machine learning, inference, ...)
     
  • Reuse of existing algorithms in literature
     
  • Concrete use case: connecting Fleetpy to MATSim

Messaging concept

  • MATSim (server) and dispatcher (client)

     
  • Connection via ZeroMQ
    • REQREP mode: one request follows a response follows a request
    • Keeping the message exchange simple

       
  • Messages encoded in JSON
    • Not optimal, but easy to follow (potential to replace)
       
  • Dispatching step parametrizable in MATSim, for each
    • MATSim sends state (vehicles, requests, ...)
    • Dispatcher answer with assignment (vehicle schedules, ...)

Additional information

Implemented

  • Request network information to have an idea about the topology










     
  • Request travel time information from MATSim


     

 

Future

  • Routing service to load off routing information to MATSim
  • Charging state, charging stations, ...
  • ...

Example implementations

  • Random assignment
    Random request meets random vehicle
     
  • Bipartite matching
    Minimize overall empty distance
     
  • Roaming dispatcher
    Cruising and serving next found request
    Manual routing using networkx
     
  • Insertion dispatcher
    Python-version of DRT algorithm (almost)
     
  • Q-learning dispatcher
    Learns a rebalancing matrix over iterations

Chouaki, T., Hörl, S., & Puchinger, J. (2022). Implementing reinforcement learning for on-demand vehicle rebalancing in MATSim. Procedia Computer Science, The 13th International Conference on Ambient Systems, Networks and Technologies (ANT 2022), 201, 134–141. https://doi.org/10.1016/j.procs.2022.03.020

Example implementations

  • Random assignment
    Random request meets random vehicle
     
  • Bipartite matching
    Minimize overall empty distance
     
  • Roaming dispatcher
    Cruising and serving next found request
    Manual routing using networkx
     
  • Insertion dispatcher
    Python-version of DRT algorithm (almost)
     
  • Q-learning dispatcher
    Learns a rebalancing matrix over iterations

Chouaki, T., Hörl, S., & Puchinger, J. (2022). Implementing reinforcement learning for on-demand vehicle rebalancing in MATSim. Procedia Computer Science, The 13th International Conference on Ambient Systems, Networks and Technologies (ANT 2022), 201, 134–141. https://doi.org/10.1016/j.procs.2022.03.020

Example implementations

  • Random assignment
    Random request meets random vehicle
     
  • Bipartite matching
    Minimize overall empty distance
     
  • Roaming dispatcher
    Cruising and serving next found request
    Manual routing using networkx
     
  • Insertion dispatcher
    Python-version of DRT algorithm (almost)
     
  • Q-learning dispatcher
    Learns a rebalancing matrix over iterations

Chouaki, T., Hörl, S., & Puchinger, J. (2022). Implementing reinforcement learning for on-demand vehicle rebalancing in MATSim. Procedia Computer Science, The 13th International Conference on Ambient Systems, Networks and Technologies (ANT 2022), 201, 134–141. https://doi.org/10.1016/j.procs.2022.03.020

Benchmarking testbed

  • Road network of Paris provided as an example (OpenStreetMap)
     
  • Fleet generation script: random distribution of vehicles in the network
     
  • Demand generation script
    • Definition of N attractors / emitters with morning / evening factors
    • Requests are generated from / to those points depending on time of day
    • Represents directionality by time of day and spatial imbalance

Benchmarking results

Three dispatchers

  • Euclidean bipartite matching
  • Insertion heuristic (DRT)
  • Q-Learning

 

Analysis

  • Average over 10 seeds

Benchmarking results

Three dispatchers

  • Euclidean bipartite matching
  • Insertion heuristic (DRT)
  • Q-Learning

 

Analysis

  • Average over 10 seeds
  • Q-Learning: 25 iterations

How to run

As a module

  • Replaces individual DRT modes (configurable)
  • Port given in configuration or written to tmp

Standalone

  • Includes parametrizable Paris test case
  • Allows to run all benchmarks

1

2

3

4

Teaser: LLM-based algorithm adaptation

  • Algorithms are often general purpose
     
  • What if we integrate context-specific heuristics (bridges, bottlenecks)?
    • Local knowledge > translation into rules > implementation > testing
    • Work-intensive process!
       
  • Let's let an LLM take an algorithm and customize it iteratively!

Profit-Optimized Dispatching with Cluster-
Specific Profit-Weighted Momentum and Adaptive Rejection Thresholding

Thank you!

sebastian.horl@irt-systemx.fr

Icons throughout the presentation: https://fontawesome.com

Website

Contact

Benchmarking on-demand mobility algorithms using a new remote dispatching interface for MATSim

By Sebastian Hörl

Benchmarking on-demand mobility algorithms using a new remote dispatching interface for MATSim

MATSim User Meeting 2026

  • 63