Multidimensional vehicle loads and capacities for Demand Responsive Transport in MATSim

Tarek Chouaki, Sebastian Hörl

13 June 2025

MATSim User Meeting 2025

  • MATSim allows to simulate on-demand mobility services (DRT)
     
  • For a long time, one request represented one person and one seat in the fleet management algorithm
     
  • However, it is useful to cover situations with more complex loads and capacities:
    • Groups of passengers (multiple persons)
    • Passengers with luggage (and luggage space in vehicles)
    • Transportation of goods ...
    • ... with compartments for normal and cold goods
    • and so on ...
       
  • Large interest in hybrid on -demand services for the transport of passengers and goods in literature

Introduction

  • Group travel (contribution by MOIA)
    • Allows to assign a group identifier to each request
    • Requests with the same group identifier much be dispatched together (i.e. occupying multiple seats in the vehicle)
    • Allows for the simulation of group bookings
       
  • Companions (contribution by Volkswagen)
    • Samples, for each traveler request, a couple of virtual agents that represent accompanying persons
    • Using the group identifier functionality, group requests can be simulated comfortably
    • Number of companions is sampled according to predefined distributions (zero, one, two companions, ...)

Existing work

  • Each request has a latest departure time and a latest arrival time



     
  • Each vehicle has a schedule of tasks



     
  • The goal of DRT's insertion algorithm is to insert a pickup and a dropoff for a new request such that not timing constraints of the requests (new and existing) are violated.
     
  • And, importantly, the capacity constraint (= seats) of the vehicle should not be violated

DRT Algorithm

t_\text{pickup} \leq t_\text{latestDepartureTime}
t_\text{dropoff} \leq t_\text{latestArrivalTime}

Pickup R2

Pickup R1

Dropoff R1

Dropoff R2

  • Previously, a capacity was simply represented by an integer
  • Now, a capacity (and each load of a request) is represented by a complex object
  • The DvrpLoad interface encapsulates arithmetic operators

Modifications

int
  • Previously, a capacity was simply represented by an integer
  • Now, a capacity (and each load of a request) is represented by a complex object
  • The DvrpLoad interface encapsulates arithmetic operators
  • DvrpLoadType is a global instance that manages creation of load objects

Modifications

  • Previously, a capacity was simply represented by an integer
  • Now, a capacity (and each load of a request) is represented by a complex object
  • The DvrpLoad interface encapsulates arithmetic operators
  • DvrpLoadType is a global instance that manages creation of load objects

Modifications

Initializes the load of a vehicle (= empty)

  • Previously, a capacity was simply represented by an integer
  • Now, a capacity (and each load of a request) is represented by a complex object
  • The DvrpLoad interface encapsulates arithmetic operators
  • DvrpLoadType is a global instance that manages creation of load objects

Modifications

Set up the load of a request or the capacity of a vehicle

  • Previously, a capacity was simply represented by an integer
  • Now, a capacity (and each load of a request) is represented by a complex object
  • The DvrpLoad interface encapsulates arithmetic operators
  • The DRT InsertionGenerator is modified to limit insertion points

Modifications

Check whether a request can be inserted given the current load of a vehicle along the schedule

requestLoad.fitsIn(currentVehicleCapacity)

Modifications

Calculate the load after picking up a request

  • Previously, a capacity was simply represented by an integer
  • Now, a capacity (and each load of a request) is represented by a complex object
  • The DvrpLoad interface encapsulates arithmetic operators
  • The DRT InsertionGenerator is modified to limit insertion points
newOccupancy = occupancy.add(request.getLoad())

Modifications

Calculate the load after dropping off a request

  • Previously, a capacity was simply represented by an integer
  • Now, a capacity (and each load of a request) is represented by a complex object
  • The DvrpLoad interface encapsulates arithmetic operators
  • The DRT InsertionGenerator is modified to limit insertion points
newOccupancy = occupancy.subtract(request.getLoad())

Implementations

  • By default, an IntegerLoadType / IntegerLoad implementation exists
     
  • Alternatively, we offer the IntegersLoadType / IntegersLoad with independent slots
    • For instance, one slot for persons, one slot for luggage
    • Or, one slot for standard goods, one slot for cooled goods
       
  • More complex implementations are possible, for instance:
    • Capacity for persons       ; load of persons for one request
    • Capacity for luggage       ; load of luggage for one request
       
    • Luggage either consumes space for persons (seats) or luggage
       
C_p
C_l
L_p
L_l
fitsIn: 
  • The entire functionality can be used by
    • Modifying config.xml
    • Providing capacities in vehicles.xml / fleet.xml
    • Providing loads in population.xml
       
  • No code modification necessary!

Usage

  • Enabling multi-dimensional loads and capacities

Usage

A list of slot names can be provided in configuration when adding the load parameter set to the DRT mode configuration.

  • Loads can be defined per trip (in the origin activity) or per person

Usage

Option 1: As a single string-based attribute

Option 2: As individual attributes per slot

Option 3: If no attributes are specified, one agent equals one capacity unit in the slot that is by default configured as "passengers"

  • Capacities can still be defined using the fleet.xml file
  • In the config.xml, it can be defined which slot the vehicle capacity represents

Usage

fleet.xml

  • However, we recommend loading vehicles from a vehicles.xml (standard functionality in DRT already)
  • Capacities can be defined per vehicle or per vehicle type using attributes

Usage

Option 1: As a single string-based attribute

Option 2: As individual attributes per slot

  • Finally, MATSim vehicle types already provide capacity information:





     
  • You can map those attributes to the slots via configuration:

Usage

  • Furthermore, DRT has been extended to allow capacity changes of vehicles during the day
     
  • This allows vehicles to update their configuration at a depot, for instance, to mount or unmount cooling equipment
     
  • A new CapacityChangeTask is introduced to DRT that defines a new capacity for the vehicle. It can be inserted into the vehicle schedules by a custom logic to be implemented by the user.

 

  • The insertion algorithm has been updated to track the vehicle's capacity while going through possible insertion points.

Bonus: Capacity changes

  • No noticeable impact

 

Impact on performance

  • For more details, see our presentation for hEART!
     
  • Randomly generated demand for Paris
    • 10,000 passenger requests with two peaks
    • 5,800 food requests with two different peaks
    • Both have different criteria (only latest arrival time for food)

Example

  • For more details, see our presentation for hEART!
     
  • We propose an algorithm that adaptively reconfigures the fleet throughout the day to serve as much demand as possible

Example

Questions?

tarek.chouaki@irt-systemx.fr