ScienceDirect
Available online at www.sciencedirect.com
Procedia Computer Science 201 (2022) 614–620
1877-0509 © 2022 The Authors. Published by Elsevier B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the Conference Program Chairs.
10.1016/j.procs.2022.03.080
10.1016/j.procs.2022.03.080 1877-0509
© 2022 The Authors. Published by Elsevier B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the Conference Program Chairs.
Available online at www.sciencedirect.com
Procedia Computer Science 00 (2022) 000–000
www.elsevier.com/locate/procedia
The 11th International Workshop on Agent-based Mobility, Traffic and Transportation Models,
(ABMTRANS) March 22 - 25, 2022, Porto, Portugal
Creating an agent-based long-haul freight transport model for
Germany
Chengqi Lua,∗, Kai Martins-Turnera, Kai Nagela
aTechnische Universität Berlin, Chair of Transport Systems Planning and Transport Telematics, Straße des 17. Juni 135, 10623 Berlin, Germany
Abstract
The freight traffic plays an important role in the agent-based transport simulation models. Compared to the commuter traffic, the
freight traffic receives relatively less attention. This study aims to bring freight traffic into the spotlight of the traffic simulation.
In this study, the long-haul freight traffic for Germany is generated based on open-source data in the context of an agent-based
model. The outcome of this study, which is also open-sourced, can be applied to any of the simulation scenarios within Germany.
In addition, it can also be used as a full scenario for studies on logistics and sustainable solutions for freight transport.
©2022 The Authors. Published by Elsevier B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the Conference Program Chairs.
Keywords: freight transport, long-haul, multi-agent transport model, MATSim
1. Introduction
Freight traffic is an important part of the transportation system. According to the statistics, 76.1% of the goods are
transported by road (i.e., with trucks) within Europe in 2019 [4]. In Germany, heavy goods vehicle alone contributes
to 17% of the traffic count on the freeways and highways [1]. Freight traffic also contributes to one third of CO2
emission from the road traffic[7]. Meanwhile, in the field of agent-based transport modeling, most of the focus is on
non-commercial traffic. For example, in one widely used agent-based simulation platform, MATSim, there are already
scenarios for cities all over the world, including Berlin [19], Paris [11] and Zurich [10]. In most of these scenarios,
however, the focus is the daily commute trips. The freight trips are either excluded or synthesized based on simple
algorithms. In order to improve those models, it makes sense to include better modeled freight traffic. In addition, a
well-modeled freight traffic is also essential for a more realistic analysis of the traffic congestion and the environmental
impact of the traffic system.
∗ Corresponding author. Chenqgi Lu, Tel.: +49-30-314-29592 ; fax: +49-30-314-26269
1877-0509 ©2022 The Authors. Published by Elsevier B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the Conference Program Chairs.
Available online at www.sciencedirect.com
Procedia Computer Science 00 (2022) 000–000
www.elsevier.com/locate/procedia
The 11th International Workshop on Agent-based Mobility, Traffic and Transportation Models,
(ABMTRANS) March 22 - 25, 2022, Porto, Portugal
Creating an agent-based long-haul freight transport model for
Germany
Chengqi Lua,∗, Kai Martins-Turnera, Kai Nagela
aTechnische Universität Berlin, Chair of Transport Systems Planning and Transport Telematics, Straße des 17. Juni 135, 10623 Berlin, Germany
Abstract
The freight traffic plays an important role in the agent-based transport simulation models. Compared to the commuter traffic, the
freight traffic receives relatively less attention. This study aims to bring freight traffic into the spotlight of the traffic simulation.
In this study, the long-haul freight traffic for Germany is generated based on open-source data in the context of an agent-based
model. The outcome of this study, which is also open-sourced, can be applied to any of the simulation scenarios within Germany.
In addition, it can also be used as a full scenario for studies on logistics and sustainable solutions for freight transport.
©2022 The Authors. Published by Elsevier B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the Conference Program Chairs.
Keywords: freight transport, long-haul, multi-agent transport model, MATSim
1. Introduction
Freight traffic is an important part of the transportation system. According to the statistics, 76.1% of the goods are
transported by road (i.e., with trucks) within Europe in 2019 [4]. In Germany, heavy goods vehicle alone contributes
to 17% of the traffic count on the freeways and highways [1]. Freight traffic also contributes to one third of CO2
emission from the road traffic[7]. Meanwhile, in the field of agent-based transport modeling, most of the focus is on
non-commercial traffic. For example, in one widely used agent-based simulation platform, MATSim, there are already
scenarios for cities all over the world, including Berlin [19], Paris [11] and Zurich [10]. In most of these scenarios,
however, the focus is the daily commute trips. The freight trips are either excluded or synthesized based on simple
algorithms. In order to improve those models, it makes sense to include better modeled freight traffic. In addition, a
well-modeled freight traffic is also essential for a more realistic analysis of the traffic congestion and the environmental
impact of the traffic system.
∗ Corresponding author. Chenqgi Lu, Tel.: +49-30-314-29592 ; fax: +49-30-314-26269
1877-0509 ©2022 The Authors. Published by Elsevier B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the Conference Program Chairs.
2C. Lu, K. Martins-Turner, K. Nagel /Procedia Computer Science 00 (2022) 000–000
In this study, we will focus on the long-haul freight trips for Germany. This is a good starting point, as long-haul
freight trips are less complex than the short-distance trips. And it is missing as outgoing, driving-through or incoming
traffic in the existing local and regional studies, e.g. from Martins-Turner et al. [14] or Ewert et al. [6]. Meanwhile, it
is also more general applicable to various scenarios within the scope (in this case within Germany).
Contribution: A long-haul freight traffic model for Germany based on open data is generated in the context of
an agent-based transport simulation environment, namely MATSim [9]. The model can be used, possibly with an
extraction process, on any regional scenarios within Germany. In addition, the model can also be used for national-
scale freight transport studies.
2. Generation of the German long-haul freight traffic model
2.1. About MATSim
The Multi-Agent Transport Simulation (MATSim) [9] is used in this project to materialize the freight traffic in
an agent-based model. MATSim is a widely used open-source framework1for implementing large-scale agent-based
transport simulations. It is capable of simulating large networks and populations while maintaining a relatively high
level of details. One iteration for a city wide (or even nationwide) network with tens of thousands of agents and
different modes of transport can be simulated within hours. This characteristic makes MATSim a suitable environment
to accommodate the long-haul freight traffic for Germany and relevant studies.
2.2. From open data to long-haul freight traffic in agent-based transport model
Open data from the German Federal Ministry for Digital and Transport (BMVI) [2] and the German Federal
Highway Research Institute (BASt) are used to generate the long-haul freight traffic for Germany. In addition, the Open
Street Map [17] is used to generate the road network. The freight traffic is first created based on the Verkehrsprognose
2030 [3] project data created by BMVI. The data quantify the amount of both domestic and international goods flow
between any two regions in Europe that are relevant to Germany. The Nomenclature of Territorial Units for Statistics
regions (in short, NUTS regions) [5] is used to identify the origin and destination of the goods flow. The locations
within Germany are identified with NUTS level 3 (NUTS 3) regions (see figure 1a), which is the highest and the most
detailed level in the NUTS system. The locations outside Germany are identified by NUTS regions with lower levels
(i.e., NUTS 2, NUTS 1 or NUTS 0) depending on how far the locations are away from Germany. We then map the
data to the German-European bi-level major road network, which contains all the freeways (Autobahn) and Federal
highways (Bundesstraße) inside Germany as well as the freeway network in the Continental Europe (see figure 1b).
Finally, the freight traffic is calibrated within Germany against the traffic count data available on the BASt website [1].
2.2.1. Reading and interpreting the data
The data from the Verkehrsprognose 2030 project contains detailed information on the domestic and international
freight. The amount of goods transported (in tons) between different regions, the type of the goods and the mode of
transport are all included. Each relation consists of three different runs: pre-carriage (Vorlauf), main run (Hauptlauf)
and post-carriage (Nachlauf). The terminology here is comparable to the terminology of the hub-and-spoke network
model [18]. While the main run is always present in any of the relations, the pre-carriage and the post-carriage are
optional. This structure makes it possible to represent an inter-modal freight trip by one record. For our project,
however, we treat each of the three runs as an independent trip, because we are interested in vehicles movement on
one (average) day. Therefore, we do not keep the original sequence for the logistic chain. Nevertheless, we will save
the logistic chain information from the original data as attributes when we generate the freight trips in the agent-based
model, so it can be looked-up, which logistic chain each trip belongs to. After re-structuring the trips in the data, we
keep all the freight trips that are carried out by road vehicles.
To generate an agent-based freight model from a region based freight flows data, we also need to interpret the data.
We calculate the average daily number of trucks traveling between any two regions based on the amount of the goods
1https://matsim.org/
Chengqi Lu et al. / Procedia Computer Science 201 (2022) 614–620 615
Available online at www.sciencedirect.com
Procedia Computer Science 00 (2022) 000–000
www.elsevier.com/locate/procedia
The 11th International Workshop on Agent-based Mobility, Traffic and Transportation Models,
(ABMTRANS) March 22 - 25, 2022, Porto, Portugal
Creating an agent-based long-haul freight transport model for
Germany
Chengqi Lua,∗, Kai Martins-Turnera, Kai Nagela
aTechnische Universität Berlin, Chair of Transport Systems Planning and Transport Telematics, Straße des 17. Juni 135, 10623 Berlin, Germany
Abstract
The freight traffic plays an important role in the agent-based transport simulation models. Compared to the commuter traffic, the
freight traffic receives relatively less attention. This study aims to bring freight traffic into the spotlight of the traffic simulation.
In this study, the long-haul freight traffic for Germany is generated based on open-source data in the context of an agent-based
model. The outcome of this study, which is also open-sourced, can be applied to any of the simulation scenarios within Germany.
In addition, it can also be used as a full scenario for studies on logistics and sustainable solutions for freight transport.
©2022 The Authors. Published by Elsevier B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the Conference Program Chairs.
Keywords: freight transport, long-haul, multi-agent transport model, MATSim
1. Introduction
Freight traffic is an important part of the transportation system. According to the statistics, 76.1% of the goods are
transported by road (i.e., with trucks) within Europe in 2019 [4]. In Germany, heavy goods vehicle alone contributes
to 17% of the traffic count on the freeways and highways [1]. Freight traffic also contributes to one third of CO2
emission from the road traffic[7]. Meanwhile, in the field of agent-based transport modeling, most of the focus is on
non-commercial traffic. For example, in one widely used agent-based simulation platform, MATSim, there are already
scenarios for cities all over the world, including Berlin [19], Paris [11] and Zurich [10]. In most of these scenarios,
however, the focus is the daily commute trips. The freight trips are either excluded or synthesized based on simple
algorithms. In order to improve those models, it makes sense to include better modeled freight traffic. In addition, a
well-modeled freight traffic is also essential for a more realistic analysis of the traffic congestion and the environmental
impact of the traffic system.
∗ Corresponding author. Chenqgi Lu, Tel.: +49-30-314-29592 ; fax: +49-30-314-26269
1877-0509 ©2022 The Authors. Published by Elsevier B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the Conference Program Chairs.
Available online at www.sciencedirect.com
Procedia Computer Science 00 (2022) 000–000
www.elsevier.com/locate/procedia
The 11th International Workshop on Agent-based Mobility, Traffic and Transportation Models,
(ABMTRANS) March 22 - 25, 2022, Porto, Portugal
Creating an agent-based long-haul freight transport model for
Germany
Chengqi Lua,∗, Kai Martins-Turnera, Kai Nagela
aTechnische Universität Berlin, Chair of Transport Systems Planning and Transport Telematics, Straße des 17. Juni 135, 10623 Berlin, Germany
Abstract
The freight traffic plays an important role in the agent-based transport simulation models. Compared to the commuter traffic, the
freight traffic receives relatively less attention. This study aims to bring freight traffic into the spotlight of the traffic simulation.
In this study, the long-haul freight traffic for Germany is generated based on open-source data in the context of an agent-based
model. The outcome of this study, which is also open-sourced, can be applied to any of the simulation scenarios within Germany.
In addition, it can also be used as a full scenario for studies on logistics and sustainable solutions for freight transport.
©2022 The Authors. Published by Elsevier B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the Conference Program Chairs.
Keywords: freight transport, long-haul, multi-agent transport model, MATSim
1. Introduction
Freight traffic is an important part of the transportation system. According to the statistics, 76.1% of the goods are
transported by road (i.e., with trucks) within Europe in 2019 [4]. In Germany, heavy goods vehicle alone contributes
to 17% of the traffic count on the freeways and highways [1]. Freight traffic also contributes to one third of CO2
emission from the road traffic[7]. Meanwhile, in the field of agent-based transport modeling, most of the focus is on
non-commercial traffic. For example, in one widely used agent-based simulation platform, MATSim, there are already
scenarios for cities all over the world, including Berlin [19], Paris [11] and Zurich [10]. In most of these scenarios,
however, the focus is the daily commute trips. The freight trips are either excluded or synthesized based on simple
algorithms. In order to improve those models, it makes sense to include better modeled freight traffic. In addition, a
well-modeled freight traffic is also essential for a more realistic analysis of the traffic congestion and the environmental
impact of the traffic system.
∗ Corresponding author. Chenqgi Lu, Tel.: +49-30-314-29592 ; fax: +49-30-314-26269
1877-0509 ©2022 The Authors. Published by Elsevier B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the Conference Program Chairs.
2C. Lu, K. Martins-Turner, K. Nagel /Procedia Computer Science 00 (2022) 000–000
In this study, we will focus on the long-haul freight trips for Germany. This is a good starting point, as long-haul
freight trips are less complex than the short-distance trips. And it is missing as outgoing, driving-through or incoming
traffic in the existing local and regional studies, e.g. from Martins-Turner et al. [14] or Ewert et al. [6]. Meanwhile, it
is also more general applicable to various scenarios within the scope (in this case within Germany).
Contribution: A long-haul freight traffic model for Germany based on open data is generated in the context of
an agent-based transport simulation environment, namely MATSim [9]. The model can be used, possibly with an
extraction process, on any regional scenarios within Germany. In addition, the model can also be used for national-
scale freight transport studies.
2. Generation of the German long-haul freight traffic model
2.1. About MATSim
The Multi-Agent Transport Simulation (MATSim) [9] is used in this project to materialize the freight traffic in
an agent-based model. MATSim is a widely used open-source framework1for implementing large-scale agent-based
transport simulations. It is capable of simulating large networks and populations while maintaining a relatively high
level of details. One iteration for a city wide (or even nationwide) network with tens of thousands of agents and
different modes of transport can be simulated within hours. This characteristic makes MATSim a suitable environment
to accommodate the long-haul freight traffic for Germany and relevant studies.
2.2. From open data to long-haul freight traffic in agent-based transport model
Open data from the German Federal Ministry for Digital and Transport (BMVI) [2] and the German Federal
Highway Research Institute (BASt) are used to generate the long-haul freight traffic for Germany. In addition, the Open
Street Map [17] is used to generate the road network. The freight traffic is first created based on the Verkehrsprognose
2030 [3] project data created by BMVI. The data quantify the amount of both domestic and international goods flow
between any two regions in Europe that are relevant to Germany. The Nomenclature of Territorial Units for Statistics
regions (in short, NUTS regions) [5] is used to identify the origin and destination of the goods flow. The locations
within Germany are identified with NUTS level 3 (NUTS 3) regions (see figure 1a), which is the highest and the most
detailed level in the NUTS system. The locations outside Germany are identified by NUTS regions with lower levels
(i.e., NUTS 2, NUTS 1 or NUTS 0) depending on how far the locations are away from Germany. We then map the
data to the German-European bi-level major road network, which contains all the freeways (Autobahn) and Federal
highways (Bundesstraße) inside Germany as well as the freeway network in the Continental Europe (see figure 1b).
Finally, the freight traffic is calibrated within Germany against the traffic count data available on the BASt website [1].
2.2.1. Reading and interpreting the data
The data from the Verkehrsprognose 2030 project contains detailed information on the domestic and international
freight. The amount of goods transported (in tons) between different regions, the type of the goods and the mode of
transport are all included. Each relation consists of three different runs: pre-carriage (Vorlauf), main run (Hauptlauf)
and post-carriage (Nachlauf). The terminology here is comparable to the terminology of the hub-and-spoke network
model [18]. While the main run is always present in any of the relations, the pre-carriage and the post-carriage are
optional. This structure makes it possible to represent an inter-modal freight trip by one record. For our project,
however, we treat each of the three runs as an independent trip, because we are interested in vehicles movement on
one (average) day. Therefore, we do not keep the original sequence for the logistic chain. Nevertheless, we will save
the logistic chain information from the original data as attributes when we generate the freight trips in the agent-based
model, so it can be looked-up, which logistic chain each trip belongs to. After re-structuring the trips in the data, we
keep all the freight trips that are carried out by road vehicles.
To generate an agent-based freight model from a region based freight flows data, we also need to interpret the data.
We calculate the average daily number of trucks traveling between any two regions based on the amount of the goods
1https://matsim.org/
616 Chengqi Lu et al. / Procedia Computer Science 201 (2022) 614–620
C. Lu, K. Martins-Turner, K. Nagel /Procedia Computer Science 00 (2022) 000–000 3
(a) Nomenclature of Territorial Units for Statistics
Level 3 (NUTS 3) regions - used as origin and des-
tination zones for good flows - inside Germany
(b) The German-European bi-level major road network (including freeway network for Continental Europe.
Within Germany, the Federal highway network is used additionally)
Fig. 1: Creating the long-haul freight traffic model for Germany: Illustration of origin/destination regions within Germany and the road network
transported between those two regions per year. Dividing the amount of goods transported between two regions by
the number of working days and an assumed average load of a truck, we can get the average number of freight trips
that are made between those two regions on a conventional working day.
The average number of working days are relatively easy to determine, which is around 260 days per year. The
average load of a truck, on the other hand, is not as straight forward. First, there are different type of goods with
different density. Second, the actual load on a truck can vary significantly. The trucks can be fully loaded, partially
loaded, or even empty. These two factors will lead to very different weights, even with the same type of the truck. To
make the problem even more complicated, the types of trucks running on the roads also vary. As a result, it is difficult
to come up with very accurate values based on the available data.
Because of this, we will not distinguish the type of goods or vehicle types in this project. Instead, we treat all the
goods and vehicles as uniform type. That means, for any two regions, we will sum up the total amount of goods flow
and then divide it with a single average load of vehicle. This value will be determined by a calibration process, where
traffic count data is used to minimize the difference between the generated freight traffic flow and the reality. The
calibration process will be introduced in the section 2.2.4 below.
2.2.2. Creating the German-European bi-level major road network
To accommodate the freight trips, a network is needed. Since the long-haul freight traffic for Germany includes
both domestic and international trips that span the whole Europe, a German-European bi-level major road network
is created. The network is created by merging the German-wide major road network to a European-wide freeway
network. Both networks are created based on the Open Street Map data extracts2. For the German-wide major road
network, we include all the roads marked as "motorway", "trunk" and "primary". For the European-wide freeway
network, roads marked as "motorway" and "trunk" are included3. After merging, the network is cleaned such that
roads that are not connected to the main cluster are removed (e.g., the network for the Great Britain and the islands in
the Mediterranean sea).
2https://download.geofabrik.de/
3Road types in Open Street Map: https://wiki.openstreetmap.org/wiki/Key:highway
4C. Lu, K. Martins-Turner, K. Nagel /Procedia Computer Science 00 (2022) 000–000
2.2.3. Determine the departure and arrival location
Next, we need to determine the exact departure and arrival location of each freight trip for the agent-based model.
In this project, we use a simple location assignment model. To choose a location within a region, we intersect the
German-European road network with that region. By doing so, we acquire a set of possible location choices for that
region. The departure/arrival location of a freight trip that starts from/terminates in that region is then assigned to a
location randomly chosen from the set.
For the regions within Germany, the German-wide land use data is used to improve the location choice. The land
use data is generated based on Open Street Map with an open-source tool Geofabrik [8]. We choose “industrial”,
“commercial” and “retail” as the relevant land use types for the freight trips. The land use data is in the format of
shape file and it can be used to filter the location choices for regions within Germany. By doing so, the number of
freight trips that originate from or terminate in inappropriate locations (such as in the residential area or in the middle
of nowhere) can be reduced.
As this model is meant to be open-source, the level of detail is restricted by the open-source data. When additional
information about the origins and destinations of the freight trips is available (e.g., exact locations of freight terminals),
the current location choice model can be replaced by a more sophisticated one.
2.2.4. Calibration against traffic count data
By the steps described so far, all the data entries in the Verkehrsprognose 2030 can be converted to freight trips
in an agent-based model. As mentioned above, we use the traffic count data from the BASt to determine the number
of trips. The complete counting data is available on the BASt website4. We extract the locations of all the counting
stations on the freeway and Federal highway and map them to our German-European major road network. Since we
are generating long-haul freight trips, which are mostly carried out with heavy trucks, we will use the heavy goods
vehicle (HGV) count in the counting data. For trips traveling between two regions, a route can be calculated on the
network. The route will pass through the counting stations on the way and will contribute to the traffic count.
By varying the average truck load, the number of trucks that travel between the two regions will vary. This will
then change the traffic count for each of the counting stations along the route. In order to determine the freight traffic
that is most representative to the reality, we try to minimize the total absolute error between the traffic count in our
model and the traffic count data from the BASt. Equation 1shows the objective function that we want to minimize:
min
x
i
|ci−
j
(nj·αij)|for ∀i∈Counting Stations,j∈OD pair (1)
ciis the HGV count at the counting station iand njis the number of freight trips that travel between the origin-
destination pair (OD pair). The term αij ∈{0,1}is a decision variable that determines whether the trips of OD pair
jcontribute to the traffic count at the counting station i. For each OD pair j, we can calculate the route on the road
network. The route can be considered as a set of road segments. If the road segment where the counting station i
locates is contained by the route for the OD pair j, then the route will contribute one unit of traffic count for each
vehicle that travels along the route (i.e., αij =1). Otherwise, no traffic count will be contributed (i.e., αij =0). The
value of njis determined by equation 2, where xis the average load of the truck and Ljis the total amount of good
flow for the OD pair based on the data:
s.t.nj=Lj/x(2)
By solving this optimization problem, we can find the optimal x(average load per truck) that minimize the differ-
ence between the generated traffic in the modal and the observed one in reality. Note that, in this optimization process,
we simplify the problem by assigning all the trips that travel between two given regions (i.e., an OD pair) to the same
route that connects the centroid of the origin and designation region. This is possible because the traffic counting
4https://www.bast.de/DE/Verkehrstechnik/Fachthemen/v2-verkehrszaehlung/Daten/2019_1/Jawe2019.html
Chengqi Lu et al. / Procedia Computer Science 201 (2022) 614–620 617
C. Lu, K. Martins-Turner, K. Nagel /Procedia Computer Science 00 (2022) 000–000 3
(a) Nomenclature of Territorial Units for Statistics
Level 3 (NUTS 3) regions - used as origin and des-
tination zones for good flows - inside Germany
(b) The German-European bi-level major road network (including freeway network for Continental Europe.
Within Germany, the Federal highway network is used additionally)
Fig. 1: Creating the long-haul freight traffic model for Germany: Illustration of origin/destination regions within Germany and the road network
transported between those two regions per year. Dividing the amount of goods transported between two regions by
the number of working days and an assumed average load of a truck, we can get the average number of freight trips
that are made between those two regions on a conventional working day.
The average number of working days are relatively easy to determine, which is around 260 days per year. The
average load of a truck, on the other hand, is not as straight forward. First, there are different type of goods with
different density. Second, the actual load on a truck can vary significantly. The trucks can be fully loaded, partially
loaded, or even empty. These two factors will lead to very different weights, even with the same type of the truck. To
make the problem even more complicated, the types of trucks running on the roads also vary. As a result, it is difficult
to come up with very accurate values based on the available data.
Because of this, we will not distinguish the type of goods or vehicle types in this project. Instead, we treat all the
goods and vehicles as uniform type. That means, for any two regions, we will sum up the total amount of goods flow
and then divide it with a single average load of vehicle. This value will be determined by a calibration process, where
traffic count data is used to minimize the difference between the generated freight traffic flow and the reality. The
calibration process will be introduced in the section 2.2.4 below.
2.2.2. Creating the German-European bi-level major road network
To accommodate the freight trips, a network is needed. Since the long-haul freight traffic for Germany includes
both domestic and international trips that span the whole Europe, a German-European bi-level major road network
is created. The network is created by merging the German-wide major road network to a European-wide freeway
network. Both networks are created based on the Open Street Map data extracts2. For the German-wide major road
network, we include all the roads marked as "motorway", "trunk" and "primary". For the European-wide freeway
network, roads marked as "motorway" and "trunk" are included3. After merging, the network is cleaned such that
roads that are not connected to the main cluster are removed (e.g., the network for the Great Britain and the islands in
the Mediterranean sea).
2https://download.geofabrik.de/
3Road types in Open Street Map: https://wiki.openstreetmap.org/wiki/Key:highway
4C. Lu, K. Martins-Turner, K. Nagel /Procedia Computer Science 00 (2022) 000–000
2.2.3. Determine the departure and arrival location
Next, we need to determine the exact departure and arrival location of each freight trip for the agent-based model.
In this project, we use a simple location assignment model. To choose a location within a region, we intersect the
German-European road network with that region. By doing so, we acquire a set of possible location choices for that
region. The departure/arrival location of a freight trip that starts from/terminates in that region is then assigned to a
location randomly chosen from the set.
For the regions within Germany, the German-wide land use data is used to improve the location choice. The land
use data is generated based on Open Street Map with an open-source tool Geofabrik [8]. We choose “industrial”,
“commercial” and “retail” as the relevant land use types for the freight trips. The land use data is in the format of
shape file and it can be used to filter the location choices for regions within Germany. By doing so, the number of
freight trips that originate from or terminate in inappropriate locations (such as in the residential area or in the middle
of nowhere) can be reduced.
As this model is meant to be open-source, the level of detail is restricted by the open-source data. When additional
information about the origins and destinations of the freight trips is available (e.g., exact locations of freight terminals),
the current location choice model can be replaced by a more sophisticated one.
2.2.4. Calibration against traffic count data
By the steps described so far, all the data entries in the Verkehrsprognose 2030 can be converted to freight trips
in an agent-based model. As mentioned above, we use the traffic count data from the BASt to determine the number
of trips. The complete counting data is available on the BASt website4. We extract the locations of all the counting
stations on the freeway and Federal highway and map them to our German-European major road network. Since we
are generating long-haul freight trips, which are mostly carried out with heavy trucks, we will use the heavy goods
vehicle (HGV) count in the counting data. For trips traveling between two regions, a route can be calculated on the
network. The route will pass through the counting stations on the way and will contribute to the traffic count.
By varying the average truck load, the number of trucks that travel between the two regions will vary. This will
then change the traffic count for each of the counting stations along the route. In order to determine the freight traffic
that is most representative to the reality, we try to minimize the total absolute error between the traffic count in our
model and the traffic count data from the BASt. Equation 1shows the objective function that we want to minimize:
min
x
i
|ci−
j
(nj·αij)|for ∀i∈Counting Stations,j∈OD pair (1)
ciis the HGV count at the counting station iand njis the number of freight trips that travel between the origin-
destination pair (OD pair). The term αij ∈{0,1}is a decision variable that determines whether the trips of OD pair
jcontribute to the traffic count at the counting station i. For each OD pair j, we can calculate the route on the road
network. The route can be considered as a set of road segments. If the road segment where the counting station i
locates is contained by the route for the OD pair j, then the route will contribute one unit of traffic count for each
vehicle that travels along the route (i.e., αij =1). Otherwise, no traffic count will be contributed (i.e., αij =0). The
value of njis determined by equation 2, where xis the average load of the truck and Ljis the total amount of good
flow for the OD pair based on the data:
s.t.nj=Lj/x(2)
By solving this optimization problem, we can find the optimal x(average load per truck) that minimize the differ-
ence between the generated traffic in the modal and the observed one in reality. Note that, in this optimization process,
we simplify the problem by assigning all the trips that travel between two given regions (i.e., an OD pair) to the same
route that connects the centroid of the origin and designation region. This is possible because the traffic counting
4https://www.bast.de/DE/Verkehrstechnik/Fachthemen/v2-verkehrszaehlung/Daten/2019_1/Jawe2019.html
618 Chengqi Lu et al. / Procedia Computer Science 201 (2022) 614–620
C. Lu, K. Martins-Turner, K. Nagel /Procedia Computer Science 00 (2022) 000–000 5
stations are on the freeway and highways, and the exact locations of the origin and destination of the trips within the
respective regions do not impact the traffic count significantly.
2.2.5. Generating freight trips in agent-based model
In MATSim, an agent performs a sequence of activities during the simulation time horizon (usually a day) based
on his/her plan. If two subsequent activities are performed at different locations, they need to be connected by a trip.
The departure time of the trip is the ending time of the former activity. The departure location is the location of the
former activity, and the destination of the trip is the location of the later activity.
The agent can be created to represent a real person in the reality, or it can be used simply as a trip creator. In this
project, we will treat the agent as the trip creator, because the truck driver’s behavior and the operational model of
the freight company require more detailed information, which we do not have. In our case, to generate one trip in the
agent-based model, we just need two (dummy) activities and a leg in between for each agent. The first activity takes
place at the departure location of the freight trip and the second activity takes place at the destination location of the
freight trip. For the departure time of a trip, a random time during the day is assigned, because there is no information
in the open data used. When additional information is available, the departure time of the trips can be adjusted based
on a proper distribution.
The conversion from the annual amount of goods to daily number of trucks can lead to non-integer values and
values below one. To adapt these non-integer values to the agent-based model, we use the probability interpretation.
For the non-integer part of the value, we interpret it as the probability of having one (additional) trip. For example,
from region A to region B, there are 4.3 trips per day on average. Then we will first generate four trips from region A
to region B. Then there is a 30% probability of having another trip from region A to region B.
2.3. Extraction and adaptation of freight trips for a given scenario
As mentioned in the introduction section, applying the German long-haul freight traffic on different regional sce-
narios is one of the major use cases. In order to achieve that, an extraction and adaptation process may be needed.
Unlike the German-European bi-level major road network used in the long-haul freight traffic model, most of the
MATSim scenarios in Germany are based on smaller but denser networks (e.g., in Open-Berlin-Scenario [19]). As a
result, the plans need to be extracted and adapted before adding it to the scenario.
To extract and adapt the plans, we need the network and the study area (in the format of shape file) of the target
scenario (i.e., the regional scenario where we want to add the long-haul freight trips). First, we overlay the study area
onto the German-European network from the long-distance freight model. Then we can categorize the freight trips
into four different categories: (1) both origin and destination within the study area, (2) either origin or destination
within the study area, (3) the route passing through the study area, (4) not touching the study area at all. The first three
types of freight trips are relevant to the scenario, and will be extracted from the freight trips model. For the trips with
both origin and destination within the study area, no adjustment is required. For the trips with origin and/or destination
outside the study area (i.e., case (2) and (3)), we will perform the trip trimming process.
To trim the trips with segments outside the study area, we will first calculate the route for those trips on the German-
European network. The intersection between the route and the boundary of the study area will be the location where
the trip will enter and/or exit the study area. The trip can then be divided into different parts. We will take the trip
segment within the study area and discard the other trip segment(s). The departure time of those trips is set to the
original departure time at the original starting location plus the travel time from there to the entry point of the study
area.
Finally, we adapt all the extracted freight trips to the network of the target scenario, by mapping the coordinates of
trips locations (i.e., origins and destinations) from the German-European network to the network of the target scenario.
3. Results
After applying the whole process, we reach 923,588 long-haul freight trips throughout Germany for a normal
working day. This is based on an average truck load of 13 tons, which is determined by the calibration process
6C. Lu, K. Martins-Turner, K. Nagel /Procedia Computer Science 00 (2022) 000–000
mentioned in the section 2.2.4. The freight plans, the scripts as well as the open-source raw data are all openly
available and can be easily adapted to different studies or reproduced based on custom data 5.
Figure 2a shows the resulting freight trips on the German-European major road network. Each semi-transparent
line in the figure represent one single trip. For a better visualization effect, we show 25% of the total freight trips.
To demonstrate the extraction and trimming process (see Sec. 2.3), a geometry (shape file) representing the dummy
study area is fed to the script and the extracted freight trips are shown in Figure 2b. Please note that the departure and
arrival locations of all the trips are within or on the boundary of the given geometry. This means the trips can be easily
mapped to a (smaller and denser) network of the study area.
(a) Illustration of long-haul freight traffic for Germany on the German-European
network (25 percent of the trips are shown for better illustration purpose)
(b) Illustration of the extraction process: only the relevant trips for the dummy
study area (purple polygon) are kept
Fig. 2: Results
The long-haul freight model generated in this study has already been applied to various open scenarios in Ger-
many. The Düsseldorf scenario [15] (based on the KoMoDnext project [13]) and Kelheim scenario [16] (based on
KelRide project [12]) are two examples. The added long-haul freight trips help to increase the representativeness of
the scenarios to the reality.
4. Conclusion and Outlook
In this project, long-haul freight traffic for Germany is created in the context of agent-based traffic model based on
publicly available data. The generated trip data as well as the scripts are all open-source and can be easily adapted to
different scenarios within Germany. When additional information or project-specific data is available, users can also
adapt the scripts to the data and re-generate the freight traffic according to their need. The long-haul freight model
in this project is also a very suitable scenario for studies on logistics, environment impact of freight traffic as well as
nation-wide sustainable freight system.
5https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/german-wide-freight/
Chengqi Lu et al. / Procedia Computer Science 201 (2022) 614–620 619
C. Lu, K. Martins-Turner, K. Nagel /Procedia Computer Science 00 (2022) 000–000 5
stations are on the freeway and highways, and the exact locations of the origin and destination of the trips within the
respective regions do not impact the traffic count significantly.
2.2.5. Generating freight trips in agent-based model
In MATSim, an agent performs a sequence of activities during the simulation time horizon (usually a day) based
on his/her plan. If two subsequent activities are performed at different locations, they need to be connected by a trip.
The departure time of the trip is the ending time of the former activity. The departure location is the location of the
former activity, and the destination of the trip is the location of the later activity.
The agent can be created to represent a real person in the reality, or it can be used simply as a trip creator. In this
project, we will treat the agent as the trip creator, because the truck driver’s behavior and the operational model of
the freight company require more detailed information, which we do not have. In our case, to generate one trip in the
agent-based model, we just need two (dummy) activities and a leg in between for each agent. The first activity takes
place at the departure location of the freight trip and the second activity takes place at the destination location of the
freight trip. For the departure time of a trip, a random time during the day is assigned, because there is no information
in the open data used. When additional information is available, the departure time of the trips can be adjusted based
on a proper distribution.
The conversion from the annual amount of goods to daily number of trucks can lead to non-integer values and
values below one. To adapt these non-integer values to the agent-based model, we use the probability interpretation.
For the non-integer part of the value, we interpret it as the probability of having one (additional) trip. For example,
from region A to region B, there are 4.3 trips per day on average. Then we will first generate four trips from region A
to region B. Then there is a 30% probability of having another trip from region A to region B.
2.3. Extraction and adaptation of freight trips for a given scenario
As mentioned in the introduction section, applying the German long-haul freight traffic on different regional sce-
narios is one of the major use cases. In order to achieve that, an extraction and adaptation process may be needed.
Unlike the German-European bi-level major road network used in the long-haul freight traffic model, most of the
MATSim scenarios in Germany are based on smaller but denser networks (e.g., in Open-Berlin-Scenario [19]). As a
result, the plans need to be extracted and adapted before adding it to the scenario.
To extract and adapt the plans, we need the network and the study area (in the format of shape file) of the target
scenario (i.e., the regional scenario where we want to add the long-haul freight trips). First, we overlay the study area
onto the German-European network from the long-distance freight model. Then we can categorize the freight trips
into four different categories: (1) both origin and destination within the study area, (2) either origin or destination
within the study area, (3) the route passing through the study area, (4) not touching the study area at all. The first three
types of freight trips are relevant to the scenario, and will be extracted from the freight trips model. For the trips with
both origin and destination within the study area, no adjustment is required. For the trips with origin and/or destination
outside the study area (i.e., case (2) and (3)), we will perform the trip trimming process.
To trim the trips with segments outside the study area, we will first calculate the route for those trips on the German-
European network. The intersection between the route and the boundary of the study area will be the location where
the trip will enter and/or exit the study area. The trip can then be divided into different parts. We will take the trip
segment within the study area and discard the other trip segment(s). The departure time of those trips is set to the
original departure time at the original starting location plus the travel time from there to the entry point of the study
area.
Finally, we adapt all the extracted freight trips to the network of the target scenario, by mapping the coordinates of
trips locations (i.e., origins and destinations) from the German-European network to the network of the target scenario.
3. Results
After applying the whole process, we reach 923,588 long-haul freight trips throughout Germany for a normal
working day. This is based on an average truck load of 13 tons, which is determined by the calibration process
6C. Lu, K. Martins-Turner, K. Nagel /Procedia Computer Science 00 (2022) 000–000
mentioned in the section 2.2.4. The freight plans, the scripts as well as the open-source raw data are all openly
available and can be easily adapted to different studies or reproduced based on custom data 5.
Figure 2a shows the resulting freight trips on the German-European major road network. Each semi-transparent
line in the figure represent one single trip. For a better visualization effect, we show 25% of the total freight trips.
To demonstrate the extraction and trimming process (see Sec. 2.3), a geometry (shape file) representing the dummy
study area is fed to the script and the extracted freight trips are shown in Figure 2b. Please note that the departure and
arrival locations of all the trips are within or on the boundary of the given geometry. This means the trips can be easily
mapped to a (smaller and denser) network of the study area.
(a) Illustration of long-haul freight traffic for Germany on the German-European
network (25 percent of the trips are shown for better illustration purpose)
(b) Illustration of the extraction process: only the relevant trips for the dummy
study area (purple polygon) are kept
Fig. 2: Results
The long-haul freight model generated in this study has already been applied to various open scenarios in Ger-
many. The Düsseldorf scenario [15] (based on the KoMoDnext project [13]) and Kelheim scenario [16] (based on
KelRide project [12]) are two examples. The added long-haul freight trips help to increase the representativeness of
the scenarios to the reality.
4. Conclusion and Outlook
In this project, long-haul freight traffic for Germany is created in the context of agent-based traffic model based on
publicly available data. The generated trip data as well as the scripts are all open-source and can be easily adapted to
different scenarios within Germany. When additional information or project-specific data is available, users can also
adapt the scripts to the data and re-generate the freight traffic according to their need. The long-haul freight model
in this project is also a very suitable scenario for studies on logistics, environment impact of freight traffic as well as
nation-wide sustainable freight system.
5https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/german-wide-freight/
620 Chengqi Lu et al. / Procedia Computer Science 201 (2022) 614–620
C. Lu, K. Martins-Turner, K. Nagel /Procedia Computer Science 00 (2022) 000–000 7
As this is the first version of the the long-haul freight trips model for Germany, there are also several aspects
that can be improved or further developed. For example, the departure time of the freight trips, the freight vehicles
composition and loading condition of the freight vehicles for different types of goods are all simplified in the current
model. In addition, the operational aspects of the freight traffic are also not included in this model. For example, the
exact locations of freight terminals or hubs and the driver-vehicle rotation can also have impact on the pattern of the
freight trips in the network. As a more complex model will require additional information and data-processing, this
calls for further studies. Meanwhile, thanks to the open-source design, users, who are in need of a more sophisticated
freight traffic model, can improve the current version by feeding in the data they have.
Acknowledgement
This work was partly funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) –
398051144 and 323900421.
References
[1] Bundesanstalt für Straßenwesen, accessed in December 2021. Automatische zählstellen 2020. https://www.bast.de/DE/
Verkehrstechnik/Fachthemen/v2-verkehrszaehlung/Aktuell/zaehl_aktuell_node.html.
[2] Bundesministerium für Verkehr und digitale Infrastruktur, 2016a. Bundesverkehrswegeplan 2030. http://www.bmvi.de/DE/Themen/
Mobilitaet/Infrastrukturplanung-Investitionen/Bundesverkehrswegeplan-2030/bundesverkehrswegeplan-2030.html.
[3] Bundesministerium für Verkehr und digitale Infrastruktur, 2016b. Verkehrsprognose 2030. https://daten.clearingstelle-verkehr.
de/276/.
[4] Eurostat, 2019. Road freight transport statistics. https://ec.europa.eu/eurostat/statistics-explained/index.php?title=
Freight_transport_statistics_-_modal_split.
[5] Eurostat, accessed in December 2021. Nuts - nomenclature of territorial units for statistics. https://ec.europa.eu/eurostat/web/
gisco/geodata/reference-data/administrative-units-statistical-units/nuts.
[6] Ewert, R., Martins-Turner, K., Thaller, C., Nagel, K., 2021. Using a route-based and vehicle type specific range constraint for improving
vehicle routing problems with electric vehicles. Transportation Research Procedia 52, 517–524. doi:10.1016/j.trpro.2021.01.061.
[7] Forschungs Informations System, 2021. Luft- und klimabelastung durch güterverkehr. https://www.forschungsinformationssystem.
de/servlet/is/39787/.
[8] Geofabrik tool, accessed in December 2021. https://www.geofabrik.de/.
[9] Horni, A., Nagel, K., Axhausen, K.W. (Eds.), 2016. The Multi-Agent Transport Simulation MATSim. Ubiquity, London. doi:10.5334/baw.
[10] Horni, A., Vitins, B., Axhausen, K., 2011. The zurich scenario: A technical overview. Institut für Verkehrsplanung und Transportsysteme
(IVT), ETH Zürich, Zürich .
[11] Hörl, S., Balac, M., 2021. Synthetic population and travel demand for paris and Île-de-france based on open and publicly available data.
Transportation Research Part C: Emerging Technologies 130, 103291. doi:10.1016/j.trc.2021.103291.
[12] KelRide: Weather-proof smart shuttle, accessed in December 2021. https://www.vsp.tu-berlin.de/menue/forschung/projects/
2021/kelride.
[13] KoMoDnext: Automatisiertes Fahren im digitalen Testfeld Dusseldorf, accessed in December 2021. https://www.vsp.tu-berlin.de/
menue/forschung/projects/2020/komodnext.
[14] Martins-Turner, K., Grahle, A., Nagel, K., Göhlich, D., 2020. Electrification of urban freight transport - a case study of the food retailing
industry. Procedia Computer Science 170, 757–763. doi:10.1016/j.procs.2020.03.159.
[15] MATSim open Dusseldorf Scenario, accessed in December 2021. https://github.com/matsim-scenarios/matsim-duesseldorf.
[16] MATSim open Kelheim Scenario, accessed in December 2021. https://github.com/matsim-scenarios/matsim-kelheim.
[17] OpenStreetMap, accessed 2021-06-23. http://www.openstreetmap.org.
[18] Verein Netzwerk Logistik (VNL), . Logistik-wörterbuch. hub and spoke systeme. https://www.vnl.at/de/services/
logistik-woerterbuch/logistik-woerterbuch-detail/?no_cache=1&tx_ecxdictionary_pi%5Bitem%5D=196. Accessed 02-
Dec-2020.
[19] Ziemke, D., Kaddoura, I., Nagel, K., 2019. The MATSim Open Berlin Scenario: A multimodal agent-based transport simulation scenario
based on synthetic demand modeling and open data. Procedia Computer Science 151, 870–877. doi:10.1016/j.procs.2019.04.120.