AN AGENT-BASED VEHICLE ROUTING SIMULATION TOOL FOR ROAD
NETWORKS WITH TIME-VARIANT DATA
Bhakti S S Onggo
Department of Management Science
Lancaster University Management School
Lancaster LA1 4YX
United Kingdom
KEYWORDS
Agent-based simulation, simulation, vehicle routing, road
networks, green logistics, transportation.
ABSTRACT
Simulation modeling is one of the analytic techniques
commonly used for transportation management; it includes
such activities as route planning and post-operation analysis.
One of the simulation methods, agent-based simulation, has
become increasingly popular due to the availability of good
micro-level data collected through technologies such as
GPS-enabled devices and road sensors. This paper presents
the design and implementation of an agent-based simulation
tool that can be used to analyse vehicle routing algorithms.
We demonstrate how the tool can be used in practice by
implementing two vehicle routing algorithms: shortest-path
and LANTIME. LANTIME is an algorithm that can be used
to minimize CO2 emissions.
INTRODUCTION
In this work, we are interested in the use of agent-based
simulation in logistics, especially in the management of
transportation operations. Transportation operations are
concerned with activities involving moving something from
one place to another using one or more modes of transport
(air, road, rail, water, hybrid). The activities include route
planning, real-time tracking, measuring key performance
indicators, post-operation analysis, etc.
Simulation modelling is one of the techniques commonly
used in the management of transportation operations. In the
context of transportation management, simulation has been
used as a visualisation tool, a stochastic optimisation tool
and a scenario analysis tool. As a visualization tool,
simulation is used to produce an animation that shows the
movement of vehicles. The simulation is usually done after
routes are generated by an optimisation model. Simulation
can also be used as an optimisation tool. In this case, the
optimisation model is embedded into the simulation model.
The simulation optimization model is then run to find an
optimal solution. This approach allows us to include
stochastic elements in the optimization. In the last case, a
simulation model is used to compare a number of scenarios.
Hence, the model is not designed to find an optimum
solution. Instead, a simulation model is used to find the best
solution from a given set of alternative solutions.
Michael Bažant, Jiří Popelka
Department of Software Technologies
Faculty of Electrical Engineering and Informatics
University of Pardubice
Pardubice, Czech Republic
The simulation modelling techniques used in transportation
management include system dynamics, discrete-event
simulation, agent-based simulation and microsimulation. In
system dynamics, we do not model individual vehicles.
Instead, we treat vehicles like fluid flowing from one place
to another. It is essentially a flow model. The focus is
usually on the evaluation of certain strategic policies. For
example, Armenia et al. (2010) developed a system
dynamics model to assess an alternative fuels policy for a
sustainable transportation system. Discrete-event simulation
models invidual vehicles as entities moving around a
network of queues. The queues are typically formed because
the vehicles need to access shared resources such as an
intersection. For example, Yoginath and Perumalla (2008)
developed a large-scale discrete-event traffic simulation
model. Similar to discrete-event simulation, agent-based
simulation also models individual vehicles. However, we do
not view the vehicles as entities moving from one queue to
another. Instead, we view the vehicles as agents moving on a
road network. An agent is considered to be more complex
than an entity because an agent is autonomous (i.e. it does
not have a central controller that makes the decisions for all
agents) and can be made adaptive (i.e. it may learn and
update its own rules). Chen and Cheng (2010) reviewed the
application of agent technology in traffic and transportation
systems and included a section on modelling and simulation.
Microsimulation is essentially a simpler version of agentbased simulation, which makes it less compute-intensive and
execution.
TRANSIMS
enables
larger-scale
(http://web.anl.gov/TRACC/Computing_Resources/transims.
html) is one of the better-known examples.
This paper describes our initial work to contribute to the
field of agent-based simulation applications for the
management of transportation operations. We have
developed an agent-based simulation tool that allows us to
model the movements of vehicles from one depot to a
number of customers based on two routing strategies. The
first strategy is based on the shortest-path algorithm; it
assumes the same constant speed on all road segments in the
planning. The second strategy takes into account the
expected speeds in different road segments and different
timeslots. The second strategy represents a green strategy
that aims to reduce the CO2 emissions produced during the
transport of goods. The simulation tool has been designed to
allow us add new routing algorithms.
The remainder of this paper is organised as follows. First, we
explain the data source used in the simulation tool, followed
© EUROSIS-ETI
by an explanation of the two algorithms used in the
simulation tool. Next, we explain its implementation. We
will also demonstrate how the tool can be used to evaluate
vehicle routing algorithms by presenting the results of our
experiment to compare the performance of the two
algorithms under different scenarios. Finally, we conclude
our paper and consider future work.
ROAD NETWORK DATA
Good micro-level data are essential for the accurate
estimation of the parameters used in an agent-based
simulation model. Hence, the lack of good micro-level data
often hinders the use of agent-based simulation, especially if
the modeling objective requires good estimation of the
model’s parameters. For example, in the past, the lack of
good micro-level data has hindered the use of timedependent travel times in agent-based simulation of vehicle
routing studies. Nowadays, however, detailed traffic data can
be collected from GPS-enabled vehicles, GPS-enabled
mobile devices, road sensors, etc. Many of the commercial
vehicle operators use a system that can track the movements
of vehicles in greater detail. Organisations, such as INRIX
(www.itisholdings.com),
provide
extensive
traffic
information. This paper uses the road timetable data
described in Eglese et al. (2006); these are based on ITIS
Floating Vehicle Data (FVD®). The data cover the UK road
network and include average speed in various road segments
and timeslots.
VEHICLE ROUTING ALGORITHMS
We have implemented two vehicle routing algorithms that
use road network data in our simulation tool. For a given
road network, the two algorithms are used to find the
shortest path and the greenest path, respectively.
Shortest Path Routing Algorithm
We implement the shortest-path algorithm so that we can
compare the expected CO2 emissions produced by the
shortest-path algorithm and the those produced by an
algorithm that takes into account factors that affect CO2
emissions. One widely known shortest-path algorithm is that
of Djikstra (1959). Hence, we have chosen this algorithm to
be implemented in our tool. Since the upper bound of
running time in the original Dijkstra algorithm is O(n2),
where n is the number of nodes in the network, the original
algorithm is not practical for a large road network. We can
however use the road hierarchy from our road network data
to improve the speed of the algorithm by using the algorithm
described in Sanders and Schultes (2006).
LANTIME: Routing Algorithm with Time-Variant Data
One vehicle routing algorithm that is suitable for generating
greener vehicle routes is LANTIME (Maden et al. 2010).
This is because the algorithm takes into account timedependent travel times (average speed) in different road
segments and average speed is one of the key variables that
affects the CO2 emissions of a vehicle.
The algorithm has been explained in detail in Maden et al.
(2010). We will summarise it here to make it easier for the
reader. The algorithm is based on tabu search heuristics. The
pseudocode is shown in Figure 1.
1. x ← GenInitialRoutes()
2. T ← {}
3. while (TerminationCriteria() = false) {
4. N ← GetNeighbourhoodFunction()
5. X ← { x’ | x’ ∈ N (x) \ T}
6. x* ← min(X)
7. x ← x*; T ← {x*}
8. UpdateMemory()
9. }
Figure 1: LANTIME Algorithm
The initial solution (line 1) uses a parallel insertion
algorithm in which the initial route of each vehicle is seeded
with one delivery and the remaining deliveries are allocated
to the best vehicle’s route until all deliveries have been
allocated. Line 2 is the standard tabu list (T) initialization.
The termination criteria in line 3 are based on the maximum
number of iterations and the number of iterations without
any significant improvement to the solution (x). Line 4
chooses one of the four neighbourhood functions (cross
exchange, insertion/removal, one exchange and swap). Line
5 explores the neighbours of solution x using the chosen
neighbourhood function. The best route is chosen in line 6
based on a certain cost function. Next, the solution is
updated and the solution is added to the tabu list in line 7.
Finally, in line 8, we update both the short-term and longterm memories that guide the exploration of neighbours.
AGENT-BASED SIMULATION MODEL
In this section, we explain in detail the content of our agentbased simulation model. The simulation model is built using
Repast Suite (North et al. 2013).
Data
The data are stored in a CSV format. Repast provides a nice
interface with database management software through
JDBC. In this implementation, we use Oracle Database 11g
Express Edition. The database structure for the road network
is shown in Figure 2.
The database is provided by a third-party company. Hence,
we have decided not to change the structure even though the
tables are not normalised. Each record in the road segment
table represents a unique segment in the road network
identified by SegmentID. A segment is formed by two
nodes (NodeID1 and NodeID2). The level represents the
road class (e.g. Motorway, A-road, B-road, etc.). The length
of the segment in metres is stored in the field length. The
direction shows whether the segment is bidirectional, one
way from node 1 to node 2, or one way from node 2 to node
1. Each record in the speed table represents the average
speed of vehicles moving in a particular road segment, on a
certain day, at a recorded time and in a certain direction (if
the road segment is bidirectional). If the speed that we need
© EUROSIS-ETI
is not defined in the table, we can find the default speed from
a default speed table. In this case, we assume that the
average speed of vehicles travelling in a road segment will
be determined by the road class (or level) and the timeslot.
Speed
RoadSegment
PK
SegmentID
Level
Length
NodeID1
X1
Y1
NodeID2
X2
Y2
Direction
agent depot can be set manually or generated randomly. At
this stage, the tool can only support the operation of one
depot. We plan to include multiple-depot operations in the
next release.
PK
SegmentID
Direction
Day
TimeSlot
Speed
DefaultSpeed
PK
PK
Level
TimeSlot
Speed
Figure 2: Database Structure
Model structure: Agents
The model comprises five agents: controller, depot,
customer, vehicle and scheduler. Figure 3 shows the class
diagram of the agents. Each vehicle has a home depot. One
depot can be home to a number of vehicles. Hence, there is a
one-to-many relationship between an agent depot and an
agent vehicle. We use an agent scheduler to inject agent
vehicles that belong to a home depot at the start of the
simulation run. Hence, there is one-to-one relationship
between agent scheduler and agent depot. The agent
controller and agent customer are relatively independent
from other agents. Please note that the agent controller does
not make any decisions that affect other agents. It is more
like a helper agent that mainly supports the running of the
model. The agent customer is also independent from other
agents. This is the structure of the model. In the following
paragraphs we explain the role of each agent in the model in
detail.
The agent controller is responsible for advancing the current
timeslot to the next one when the simulation time has
reached the next timeslot. The timeslot windows are defined
in the speed table and in the default speed table (see Fig. 2).
Thus, this agent is generally responsible for the time
management of the simulation. The most important
behaviour of this agent is implemented in method step().
This is the one that is responsible for advancing the
simulation time and determining the current timeslot during
a simulation run. This key information is used by all agent
vehicles to calculate their speed. Each step represents one
second of simulation time.
The agent depot represents the starting point of the vehicles.
It keeps track of the time a vehicle leaves the depot and the
time the same vehicle returns to it. The depot has an
operation time window (e.g. from 5 am to 10 pm) and a
location in the road network. In the model, the operation
time window can be set manually and the location of the
Figure 3: UML class diagram for agents
The agent customer represents a customer who has a
package to be collected or is the recipient of a package. At
the moment we do not differentiate between the two types of
customer. Each customer has a service time window, i.e. s/he
needs the service within that time window. Each customer
requires a certain amount of space in the vehicle for the
package. In the implementation, we can set the number of
customer agents, their location, their service time window
and their order size using a configuration file, or generate all
of them randomly. The default service time window is
between 7 am and 10 pm.
The agent vehicle represents a vehicle that moves around the
road network. Initially, all vehicles are located at their home
depot. A vehicle will leave its home depot at a time that has
been estimated to allow the vehicle to reach its first customer
within the customer’s time window. The vehicle can use
routes that are produced using the shortest path algorithm or
the LANTIME algorithm depending on the model setting.
The agent vehicle stores information about: its depot, its
route, its current coordinates on the network, the actual edge
or node where the vehicle is currently located, its total CO2
emissions, its current speed, its total distance, its remaining
capacity for goods, its total working time and its maximum
working time. The behavior of this agent is implemented in
method
step() that determines its movement and
calculates related measures such as its CO2 emissions and
total distance.
The agent scheduler is responsible for setting up daily
operations, i.e. generating customers who require service
each day, generating the number of vehicles at the home
depot each day and generating a route for each vehicle based
on a certain routing algorithm. These tasks are done using
© EUROSIS-ETI
the method loadCustomers()that runs at the beginning
of each day during a simulation run.
EXPERIMENT
At this early stage, we have not conducted a performance
analysis to compare various routing algorithms. However,
with the current version of the tool, we can demonstrate how
the LANTIME algorithm can help to reduce the level of CO2
emissions in comparison with the shortest path routing
algorithm. For this purpose, we have conducted experiments
using four scenarios:
• Scenario 1: One vehicle with a 100-unit capacity
• Scenario 2: Two vehicles each with a 50-unit capacity
• Scenario 3: Four vehicles each with a 20-unit capacity
• Scenario 4: Ten vehicles each with a 10-unit capacity.
shortest path algorithm. Similarly, the LANTIME algorithm
produces greener routes than the shortest-path algorithm,
with an average of 170 kg of CO2 per day in comparison to
180 kg of CO2 per day for the shortest-path algorithm. This
is equivalent to an approximately 6% reduction in CO2
emissions.
The simulation duration in each experiment is 28 days. Each
vehicle can only travel between 5 am and 10 pm. Customers
are randomly generated and their service time window is set
to between 7 am and 10 pm. The results for the four
scenarios are shown in Figures 4 to 7.
In scenario 1, close to 40% of the customers cannot be
served. As expected, the result shows that using the
LANTIME algorithm, a vehicle travels an average of 508 km
per day in contrast to 499 km per day when the shortest path
algorithm is used. However, the routes generated by the
LANTIME algorithm result in lower CO2 emissions, i.e. an
average of 103 kg per day in comparison to 111 kg per day
for the shortest path algorithm. This is expected because
LANTIME takes into account expected road congestion in
its routing algorithm.
Figure 5: Two vehicles each with a 50-unit capacity
With four 20-unit capacity vehicles in scenario 3, we are
able to serve 97% of customers. Each day, on average, these
vehicles travel 952 km and emit 213 kg of CO2 using routes
produced by the LANTIME algorithm. The shortest-path
algorithm produces routes that have the vehicles travel 941
km and emit 229 kg of CO2 on average every day. In other
words, the LANTIME algorithm manages to reduce CO2
emissions by 7%.
Figure 4: One vehicle with 50-unit capacity
In scenario 2, we use two vehicles each with a 50-unit
capacity (instead of one vehicle with a 100-unit capacity as
in scenario 1). As expected, with two vehicles, we can serve
more customers every day, i.e. up to 85% of customers. As
in scenario 1, the LANTIME algorithm produces longer
routes, i.e. the two vehicles, between them, travel 830 km
per day on average in comparison to 791 km per day for the
Figure 6: Four vehicles each with a 20-unit capacity
Finally, in scenario 4, we use ten vehicles, each with a 10unit capacity. In this scenario, we can serve all customers.
Both algorithms show that we only need eight vehicles. In
this scenario, the eight vehicles travel 2,136 km and produce
© EUROSIS-ETI
391 kg of CO2 on average each day using the LANTIME
algorithm. Using the shortest-path algorithm, the travel
distance and CO2 emissions are 1,839 km and 390 kg per day
on average, respectively. In this scenario the routes produced
by both algorithms produce the same amount of CO2. This is
because each vehicle serves a cluster of nearby customers in
which the choice of road segments to is limited.
Transportation Systems.” IEEE Transactions on
Intelligent Transportation Systems 11 (2), 485-497.
Dijkstra, E.W. 1959. “A Note on Two Problems in
Connection with Graphs.” Numerische Math. 1, 269-271.
Eglese, R., W. Maden and A. Slater. 2006. “A Road
Timetable™ to aid vehicle routing and scheduling.”
Computers & Operations Research 33, 3508-3519.
Maden, W., R. Eglese and D. Black. 2010. “Vehicle routing
and scheduling with time-varying data: A case study.”
Journal of the Operational Research Society 61, 515522.
North, M.J., N.T. Collier, J. Ozik, E. Tatara, M. Altaweel,
C.M. Macal, M. Bragen and P. Sydelko. 2013. "Complex
Adaptive Systems Modeling with Repast Simphony."
Complex Adaptive Systems Modeling, Springer,
Heidelberg, FRG.
Sanders, P. and Schultes, D. 2006. “Engineering Highway
Hierarchies”. ESA 2006. LNCS, vol. 4168, pp. 804-816.
Springer, Heidelberg.
Yoginath, S.B. and K.S. Perumalla. 2008. “Parallel
Vehicular
Traffic
Simulation
using
Reverse
Computation-based Optimistic Execution.” Proceedings
of the 22nd Workshop on Principles of Advanced and
Distributed Simulation, 33-42.
Figure 7: Ten vehicles each with a 10-unit capacity
CONCLUSION
We have presented an agent-based simulation tool that we
have developed to analyse vehicle routing algorithms. At this
stage, we have implemented two algorithms in our
simulation tool: the shortest-path and LANTIME algorithms.
Our aim is to build a tool with which we can analyse a
vehicle routing algorithm using simulation. An analysis
using agent-based simulation has at least three advantages:
(1) we can add stochastic elements to the model, (2) we can
add learning agents to the model and (3) we can see the
movement of the vehicles visually on a screen. Although this
work is still at an early stage, we are able to show how the
tool can be used to compare two vehicle routing algorithms
based on their CO2 emissions. We will continue our work to
implement more routing algorithms and to add learning
agents to the model. The learning agents represent drivers
and dispatchers who can learn from past experience and
make decisions based on what they have learned.
ACKNOWLEDGEMENT
The agent-based simulation tool was developed by Mr. Jiří
Popelka as part of his Master's dissertation.
REFERENCES
Armenia, S., F. Baldoni, D. Falsini and E. Taibi. 2010. “A
System Dynamics Energy Model for a Sustainable
Transportation System.” Proceedings of the 28th
International Conference of the System Dynamics
Society.
Chen, B. and H.H. Cheng. 2010. “A Review of the
Applications of Agent Technology in Traffic and
© EUROSIS-ETI
BIOGRAPHIES
BHAKTI S S ONGGO is a lecturer in Business Process
Modeling and Simulation in the Department of Management
Science at the Lancaster University Management School,
Lancaster, United Kingdom. He completed his PhD in
Computer Science at the National University of Singapore
and his MSc in Management Science at Lancaster
University. His research interests lie in the areas of
simulation methodology (modelling paradigms and
conceptual modelling), simulation technology (parallel and
distributed simulation), business process modelling and
simulation
applications.
His
email
address
is
[email protected].
MICHAEL BAŽANT is a lecturer in Computer
Programming and Simulation in the Faculty of Electrical
Engineering and Informatics at the University of Pardubice.
He completed his PhD in Technology and Management in
Transport and Telecommunications. His research interests lie
in the areas of decision-making in the simulation models of
transportation
systems.
His
email
address
is
[email protected].
JIŘÍ POPELKA is a software engineer. He works for a
company that develops software for the state administration
in the Czech Republic. In 2012, he wrote his Master's thesis
on an agent-based simulation model for the distribution of
goods under the direction of Michael Bazant. His email
address is [email protected].
© EUROSIS-ETI
© Copyright 2026 Paperzz