Agent-Based Modelling for a Low-Carbon Transport Future

A PhD research project using ABMs to model policies for lowering transport carbon emissions

David AC
Arup’s City Modelling Lab
8 min readMar 31, 2023

--

Photo by Matthias Heyde on Unsplash

Decarbonising transport is a goal shared by every client and partner we work with in the City Modelling Lab. There is quite a lot of work to be done. For this reason, we’re always keen to hear about academic research that might help us to reach net zero sooner.

Here we present a guest post from some friends of the CML — David Alvarez Castro and Alistair Ford. Their research project, funded by EPSRC as part of the Geospatial Systems Centre for Doctoral Training at Newcastle University, uses the open-source MATSim Agent-Based Modelling software and additional tooling developed by us here in the City Modelling Lab.

We are proud to contribute to this research through our open-source tooling.

The project

The UK faces a considerable challenge in decarbonising transport. At Newcastle University, we’re exploring the use of Agent-Based Models (ABMs) to meet that challenge and deliver a net zero transport future.

In this post, we describe an ongoing PhD research project exploring the role of infrastructure interventions and behavioural changes in reducing greenhouse gas (GHG) emissions in the Tyne and Wear region of the UK.

Agent-based models in transportation planning

As Sebastian describes in an earlier CML blog post, transport simulation and modelling development has a long history, from statistical-based numerical modelling to more active and complex modelling techniques such as ABMs. ABMs are complex computer simulations of the activities of individuals in space and time, where they interact with each other and the environment and compete for the available resources to achieve their goals.

In a transport scenario, the simulated individuals interact with and compete for space on the road and public transport networks in an attempt to arrive on time at their destinations as part of their daily routines (e.g. work, medical, leisure), using different transport modes (e.g. car, bike, walk, bus, metro). The City Modelling Lab have used ABMs “in anger” to deliver several client projects.

MATSim ABMs require two main inputs:

  • a synthetic population of agents with activity plans (a.k.a. demand)
  • a transport network (a.k.a. supply)

Building the synthetic population and activity plans

The fundamental underpinning of mobility ABMs is a synthetic population of agents that represents a simplified digital twin of the actual population, with individual socio-demographic characteristics and activity plans for all of the agents in the geographic area of the study. Our first objective was, therefore, to develop a synthetic population for the North East of England, the larger area of around 2.6 million inhabitants that encompasses most of the people interacting with the smaller Tyne and Wear region that is the focus of our study.

Generating demographic attributes

Socio-demographic attributes were generated using SPENSER, a tool developed by the University of Leeds that generates a synthetic population using 2011 UK census data and can project that population up to the year 2040 (or, in our case, the year 2019). Unfortunately, the generated attributes for each individual were limited to age, sex, ethnic group, and the household ID to which they belong.

However, ABM populations typically require a greater diversity and quantity of socio-demographic data in order to represent individuals and their daily activities more accurately. Consequently, we created synthetic_population_dev — an open-source Python library — to generate eight additional attributes for each individual:

  • marital status
  • number of dependents
  • driving license
  • car access
  • bicycle access
  • economic activity
  • occupation
  • annual gross income

Values for these attributes were synthesised using open access 2011 UK census data projected to 2019 by applying ONS datasets. We validated the results of this synthesis against 2019 ONS statistical data.

Generating activity plans

We used the National Travel Survey (NTS), 2002–2020 Special Licence Access dataset from the Department for Transport to assign an activity plan to each agent. Activity plans represent an individual’s activities during a “normal” day, i.e., a working weekday. The NTS is the primary source of data on personal travel patterns by residents of England, providing information on how, why, when and where people travel, factors affecting travel, and individual socio-demographic characteristics.

A visual representation of an activity plan for a 24-hour period

Individuals from the synthetic population were matched with NTS individuals based on similar socio-demographic characteristics. The assumption was that individuals with similar socio-demographic attributes perform similar activities during a typical working day.

Additionally, individuals from the same household in the synthetic population were matched whenever possible with NTS individuals sharing the same household to allow interactions between individuals from the same dwelling, e.g. a parent accompanying a child to school, or a couple shopping together. This provides a more realistic representation of the population during their daily activities.

Once the activity plans were assigned to the agents, the start and end times, purposes of the trips, transport modes used, and distances travelled between activities were assigned. However, ABMs also need specific spatial locations (x and y coordinates) for agent destinations, and this data was missing because the granularity of the NTS dataset is at the more vague Local Authority level to maintain privacy.

Example of an activity plan for a single agent

We used OSMOX to classify OpenStreetMap buildings into seven categories to identify viable locations for each activity:

  • work
  • shop
  • leisure
  • sport
  • medical
  • eating out
  • other

Additionally, we obtained the locations of supermarkets in the region from the open-access Geolytics dataset and the locations of education facilities (0–15, 16–18, 18+) from Data.gov.uk.

Activity locations were assigned depending on the activity purpose based on:

  • origin and destination matrices (for workplaces)
  • school capacities (for education)
  • spatial interaction modelling techniques for the rest of the trip purposes, where the competitiveness, attractiveness and accessibility of each building were considered to identify the most convenient location for each agent activity

Additionally, “escort” activities were considered. These are trips where someone accompanies another person to an activity such as shopping, education or a medical appointment.

Typically, agents share trips to a given location with someone else from the same household, giving a pair of trip purposes such as escort education and education. Modelling these interactions between individuals from the same dwelling gives us a more realistic representation of the population and their trips.

Location of the activities performed by agents in Newcastle upon Tyne and Gateshead. Locations were obtained from OpenStreetMaps.

Finally, all agents with socio-demographic attributes and activity plans were merged with PAM, an open-source tool created by the CML to generate populations in the XML format required by MATSim.

Building the transport network

Our second objective was the development of the network (supply) used by agents to move between activities using a diverse range of transport modes. The network is a digital representation of the study area's road and public transport networks. Roads were extracted from OpenStreetMap (OSM) data using Geofabrik, while public transport datasets (GTFS data about stops, routes and timetables) were obtained from the DfT and Rail Delivery Group and merged using the UK2GTFS tool.

Thanks to existing tools developed by CML, we achieved this second objective faster and with fewer headaches than the first. These flexible and well-documented tools allow the creation of a rich, detailed transport network in a matter of hours.

One such tool, Puma, merges OSM and GTFS datasets, while GeNet simplifies the network to make the file smaller, thus reducing simulation runtimes. We also used GeNet to add elevation data to nodes and slope data to links using a Digital Elevation Model (DEM) (10-metre resolution) generated after merging DEMs from DEFRA for the Tyne and Wear region and viewfinderpanorama for the rest of the North East area.

The result is a set of files containing the network (network.xml), public transport schedule (schedule.xml) and public transport vehicles information (vehicles.xml) required by MATSim to run a simulation.

The connection between the population and network datasets (activity locations and network datasets via OpenStreetMap)

Current status — validating our model

The steps we have described so far generated the input data required to run simulations in MATSim. Now that we can run these simulations against our target region, our focus has shifted to the calibration and validation of our model.

MATSim is highly configurable via a config.xml file that specifies and configures the different modules and strategies to use in the simulation. This file is complex, often growing to several thousand lines of XML.

CML’s open-source MC tool provides a programmatic Python interface to create, modify and validate config.xml files. This safety net has helped us avoid many rookie mistakes that would prove fatal to our simulations, as well as enabling a better understanding of how MATSim works under the bonnet.

Our model calibration stage consists of multiple iterations around a feedback loop that looks like this:

Our model calibration loop

The goal is to bring urban mobility patterns in the simulation as close as possible to reality, using external datasets for validation.

TADU provides a dataset with vehicle counts from several roads in the study area, while Nexus, the UK Census 2011 and DfT provide information about transport mode shares and average distances travelled. We compare our results against these datasets, iterating around the feedback loop until the differences between the simulation and real-world, observed data are as small as possible. The best result becomes our “baseline scenario” — a configuration of the model that represents the real-world situation as it stands now.

Modelling different scenarios

Now we reach the fun part: introducing different urban mobility policies to explore ways to encourage agents to use active travel modes rather than private vehicles. Example policies include the introduction of dedicated cycle paths, the implementation of road user charging, or the creation of Low Traffic Neighbourhoods (LTNs) in specific zones.

Once implemented in the model, we can explore how these policies affect agent choices of transport mode. We will compare results from each scenario against the baseline scenario to identify differences in agent behaviour and explore shifts towards sustainable modes of transport.

Criteria to assess the success or failure of the various simulated policies could include the reduction in the number of vehicles on the roads, the reduction of carbon emissions generated, or the change in the number of kilometres walked/cycled by agents, among many others.

Conclusion

Our ongoing PhD research project incorporates all stages required to run a MATSim simulation, using CML’s tools to generate a very detailed synthetic population and an exhaustive transport network.

Future calibration and validation work will allow us to simulate a typical working day in the study area and use it as a benchmark for analysing many different transport policies. In this way, we aim to identify the most efficient measures for reducing GHG emissions and positively influencing real-world policy in moving towards net zero mobility.

David Alvarez Castro is a PhD student from the Geospatial Systems CDT at Newcastle University.

Alistair Ford is a Lecturer in Geospatial Data Analytics and Policy Academy Fellow at Newcastle University.

--

--

David AC
Arup’s City Modelling Lab

PhD Geospatial Systems CDT | #UrbanMobility #ABM #ActiveTravel #SustainableMobility @GeospatialCDT @UniofNewcastle