A MULTI-AGENT TRAFFIC SIMULATION FRAMEWORK FOR
EVALUATING THE IMPACT OF TRAFFIC LIGHTS
Raul Cajias, Antonio Gonzalez-Pardo and David Camacho
Departamento de Ingenier´ıa Inform´atica, Escuela Polit´ecnica Superior, Universidad Aut´onoma de Madrid
C/Francisco Tom´as y Valiente 11, 28049 Madrid, Spain
Keywords:
Multi-agent simulation, Swarm computing, Traffic optimization.
Abstract:
The growing of the number of vehicles cause serious strains on road infrastructures. Traffic jams inevitably
occur, wasting time and money for both cities and their drivers. To mitigate this problem, traffic simulation
tools based on multiagent techniques can be used to quickly prototype potentially problematic scenarios to
better understand their inherent causes. This work centers around the effects of traffic light configuration
on the flow of vehicles in a road network. To do so, a Multi-Agent Traffic Simulation Framework based on
Particle Swarm Optimization techniques has been designed and implemented. Experimental results from this
framework show an improvement in the average speed obtained by traffic controlled by adaptive over static
traffic lights.
1 INTRODUCTION
Traffic flow models help design dynamic control like
the ones just described. Flow models are typically
categorized by their level of detail in three broad
classes: microscopic, mesoscopic and macroscopic
(Hoogendoorn, 2001). Microscopic models describe
both space and time behavior of the system’s entities
(vehicles and drivers) as well as their interactions at
a high level of detail. Macroscopic models describe
traffic behavior through high-level terms like flow-
rate, density and velocity. Finally, mesoscopic models
consider dynamical properties that are simple enough
to be simulated for long time.
The work presented in this paper is an initial
study on Traffic Simulation. Agents have SWARM-
like characteristics in that they lack a reasoning pro-
cess. The main contribution of this work is re-
lated to the implementation of a configurable, agent-
based traffic simulation framework, based on the
METANET model. We model traffic flow by creating
of lightweight agents using a time series distribution,
enabling us to treat traffic jams as a particle swarm
optimization problem (Eberhart et al., 2001). We use
this approach to find dynamic traffic control config-
urations that will yield smooth flow of traffic at any
giventime. Finally, the paper shows some experimen-
tal results about how the behavior of traffic lights can
affect jams in the network, depending on the traffic-
flow distribution of the road.
(Burmeister et al., 1997) highlights the advantages
of using Multi-Agent Systems (MAS) for traffic simu-
lations. MAS has also been used for microscopic traf-
fic simulation where different characteristics of the
population parametrized for the model. (Zhang et al.,
2005) uses a MAS for simulating single-lane roads
and provide agents with a decision tree that allows
them to adapt their velocity and acceleration depend-
ing on environmental constraints and desired veloc-
ity. (Ehlert and Rothkrantz, 2001), defines profiles of
agents and analyses the impact of of agent behavior
to the system. The two profiles defined are: fast and
aggressive or slow and careful. The overall theme ex-
plored in these works are howdifferent agent behavior
impact road traffic. Furthermore, the agents fall in the
category of Belive-Desire-Intention (BDI), since they
have a complex and variable behavior that changes
based on their surroundings and goals.
Traffic network systems such as UTOPIA-SPOT,
(Mauro and Taranto, 1989), and SCOOT, (Robertson
and Bretherton, 1991), integrate a number of differ-
ent traffic network models to provide an urban traffic
management solution through the coordinated oper-
ation of traffic signals to smooth the flow of traffic
and increase circulation in cities. The use of multi-
agent systems for the modeling of traffic has been
studied among other works in (Radecky and Gaj-
dos, 2008) and (Xiao-Fan Zhi, 2008). (M. van den
443
Cajias R., Gonzalez Pardo A. and Camacho D..
A MULTI-AGENT TRAFFIC SIMULATION FRAMEWORK FOR EVALUATING THE IMPACT OF TRAFFIC LIGHTS.
DOI: 10.5220/0003181204430446
In Proceedings of the 3rd International Conference on Agents and Artificial Intelligence (ICAART-2011), pages 443-446
ISBN: 978-989-8425-41-6
Copyright
c
2011 SCITEPRESS (Science and Technology Publications, Lda.)
Berg and Hellendoorn, 2003) on the other hand, uses
the METANET model (Messmer and Papageorgiou,
1990), a macroscopic model for mixed urban and
freewaytraffic networks, that providesintegrated con-
trols for traffic flow by implementing a model predic-
tive control.
2 DESCRIPTION OF THE
MULTI-AGENT MODEL
In this section a description of the Multi-agent Sys-
tem modeled is provided. In order to understand it
correctly, the different agents and the environment are
described.
2.1 The Simulation Environment
Road networks are modeled as a weighted directed
graph N = G(V, E), with source and sink {s, t} V,
and roads e E of N. The capacity of an edge is a
mapping c : E R
+
, denoted by c
uv
. Furthermore,
the flow of the network is a mapping f : E R
+
denoted by f
uv
, subject to the following constraints:
1. Capacity constraint. For all u, v V, we require
f
uv
c
uv
.
2. Conservation of flows. For all u V {s, t}, we
require
v,u
f
vu
= 0 v, u E
3. Skew Symmetry. For all u, v V, we require f
uv
=
f
vu
Road capacity is a function of the road’s width
(number of lanes) and length. Of the two, only the
number of lanes in a road follows specific rules that
can serve to differentiate one road from another.
Given equal-length road segments, road capacity
translates to the number of vehicles that can fit that
segment, multiplied by the number of segments in a
road. Thus, by toggling the number of vehicles that
fit in a single section, new road types can be defined.
This implementation has the added benefit that traffic
accidents can easily be modeled: By decreasing the
maximum number of vehicles in a single segment for
a arbitrary number of steps, the impact of an accident
in roads can be easily simulated.
2.2 Vehicle and Traffic Light Agents
The system is composed of two types of agents: vehi-
cles and traffic lights. These agents interact with each
other by keeping track of local information available
to them, and acting accordingly.
Upon creation, vehicles are assign a shortest dis-
tance trajectory between two arbitrary points in the
road network, which will remain unchanged through-
out the life of the agent. These agents can be cre-
ated following a distribution function or at a constant
rate. As they travel through the road network, agents
require local information to decide whether to move
or stay put. This information is made available to
them by consulting the status blackboard maintained
by each road. As they traverse through the network,
vehicles can consult the status of the traffic light and
the number of cars currently residing at the immedi-
ate next road section and use this information to move
forward or stop.
Traffic light agents (TLAs) can have two states:
red and green. How long a red-to-green cycle lasts,
as well as how much of that time is allocated for each
state can be static or dynamic. The platform provides
a static agent implementation out-of-the box, and
a mechanism for attaching custom dynamic agents.
TLAs can be located at either street endpoints or in-
tersections.
A type of dynamic TLA developed was an agent
that would measure the current state of the roads lead-
ing to it, and split the total duration of it’s red-to-green
cycle to favor the most impacted road. As the current
implementation only supports intersections between
two roads, this version of an adaptable TFA only takes
care of this case. The process for this agent follows:
1. Traffic light compares the traffic flow of each
road. The following equation defines the traffic
flow of a road:
f(road) =
n
Segments
n
VehiclesPerSegment
n
VehiclesOnRoad
(1)
In this equation, n
Segments
n
VehiclesPerSegment
de-
fines the maximum number of vehicles allowed
in a road, and n
VehiclesOnRoad
is the real number of
vehicles currently on the road.
2. The traffic flow of both roads are compared to
know what road has more traffic.
3. Finally, the split of the traffic light is adjusted in
the way that the road with more traffic takes ad-
vantage. The new split is the percentage of traffic
flow that travels through the road with more traf-
fic. The equation used is the following:
NewSplit =
max( f(road
1
))
2
i=1
f(road
i
)
(2)
Where max( f(road
1
)) represents the traffic flow
of the road with more traffic, and
2
i=1
f(road
i
) is
the sum of the traffic flow of both roads.
ICAART 2011 - 3rd International Conference on Agents and Artificial Intelligence
444
3 DESIGNING A SIMULATION
Simulations are defined using an XML simulation de-
scription file. This file is used to describe all aspects
of the simulation, from the road network, types of
roads, the trajectories vehicles should take, to vehi-
cle distribution and location and type of traffic lights
to be used.
Roads are defined as a series of points in a carte-
sian plane, an orientation and one of two directions
{one-way, two-way}. Trajectories can be set to be
either street endpoints or intersections. In each, the
percentage of traffic to start from and finish in start
and finish road nodes is specified. This allows the
freedom to play with different traffic flow configura-
tions. Street-light agents can be positioned in street
endpoints or at intersections, and the duration of a
whole red-to-green state cycle can be set as well.
Once the simulation is completed, an output file is
created for each trajectory vehicles took to reach their
desired destinations. These files are also in XML for-
mat, allowing a wide range of statistics to be extracted
from each experiment.
4 EXPERIMENTAL RESULTS
The simulation framework was used to observe the
impact of both static and dynamic TLAs on flow. To
do so, we measure the average speed attained by ve-
hicles traveling down a given trajectory, and compare
like trajectories with different configuration of each
TLA.
Start Vertex
End Vertex
Plotted Section
Figure 1: A description of the road network used in this
experiment batch.
In these experiments (Figure 1), two separate sim-
ulation batteries where defined: one set for static and
one for adaptive lights. Three different situations
were used to simulate the road had a low traffic flow
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Time Steps
Average Speed
Trayectory: A to B. Static Traffic Lights
Ax1to Bx1 A to Ax1 Bx1 to Bx2 BX2 to B
Figure 2: A plot of the average speeds attained by vehicles
traversing four roads in the trajectory {a
start
b
finish
}.
(only 10% of the traffic was traveling through the
road), the road had a normal flow with 50% of the traf-
fic, and finally, the road was congested (with 90% of
the traffic). Figures 2 and 3 results of using an adap-
tive versus a static traffic light to regulate the traffic of
roads in a single trajectory with 90% of the traffic.
Figure 2 shows the average speeds of the different
roads for trajectory {a
start
b
finish
}. For vehicles
traversing the network of traffic lights, periodic
spikes and valleys begin to populate each road’s
average velocity plot. Traffic lights act as a flow
filter, smoothing out traffic velocity in the system
at each intersection, until traffic finally exits the
network at maximum speed. Towards the end of
the simulation, periodic patterns in velocity suggest
that the system reaches some equilibrium, a result
not at all surprising given the passive nature of the
interactions in the system.
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Time Steps
Average Speed
Trajectory: A to B. Adaptative Traffic Lights
Ax1to Bx1 A to Ax1 Bx1 to Bx2 BX2 to B
Figure 3: A plot of the average speeds attained by vehicles
traversing four roads in the trajectory {a
start
b
finish
}.
Introducing adaptive traffic lights into the system
yields a more interesting average graph (Figure 3).
Periodicity is still a defining characteristic of the plot,
but more interesting patterns are observed. While
quite simple in nature, the attempt by early traffic
lights to maximize vehicle flow, causes a ripple ef-
fect to later traffic lights that result in chaotic pat-
terns in the average road velocity through time. In
general, the average road velocity experiences an im-
provement over the static traffic light experiment.
A MULTI-AGENT TRAFFIC SIMULATION FRAMEWORK FOR EVALUATING THE IMPACT OF TRAFFIC
LIGHTS
445
These results coupled with the quick simulation
turnaround time yielded by this framework, suggest
that there is ample room for exploring the impact of
more complex traffic light agents, and that such terri-
tory can be covered with the help of this tool.
5 CONCLUSIONS AND FUTURE
WORK
We propose a MAS simulation framework for urban
traffic simulation, using a swarm agent model. Sim-
ulation designers are free to configure road networks
of arbitrary complexity, by customizing road width,
geometry and intersection with other roads, as well as
define source and sink locations for vehicles.
We have tested the simulation using static and dy-
namic traffic light agents, in order to observe the im-
pact to network flow. Static TLAs cycle through their
states at a constant rate, while the dynamic TLA im-
plemented attempts to optimize the average speed of
the vehicles in the network by favoring roads with
higher traffic flow. The average vehicle speed was
higher for networks with the dynamic TLAs, which
suggest that such agents may be key elements in
a wider flow optimization strategy, under more de-
manding traffic scenarios.
Further work is planned to test the performance of
these two traffic light agents in network graphs, orders
of magnitude larger that the ones used in these exper-
iments, and the implementation of a time series ve-
hicle generation function that better mimics real traf-
fic flow scenarios. We are also interested in allowing
cars to adapt their trajectory to optimize their move-
ment through the network, based on local informa-
tion available to them. Finally there is strong mo-
tivation to use automatic discovery methods such as
genetic algorithms, to find combinations of different
types of traffic light agents in a network graph, that
could reach sub-optimal network flows.
ACKNOWLEDGEMENTS
This work has been supported by the Spanish Min-
istry of Science and Innovation. Grant TIN2010-
19872.
REFERENCES
Burmeister, B., Haddadi, A., and Matylis, G. (1997). Ap-
plication of multi-agent systems in traffic and trans-
portation. IEE Proceedings - Software, 144(1):51
60.
Eberhart, R. C., Shi, Y., and Kennedy, J. (2001). Swarm In-
telligence (The Morgan Kaufmann Series in Artificial
Intelligence). Morgan Kaufmann.
Ehlert, P. A. and Rothkrantz, L. J. (2001). Microscopic traf-
fic simulation with reactive driving agents. In IEEE
Intelligent Transportation Systems Conference Pro-
ceedings, pages 861 – 866.
Hoogendoorn, S. P. (2001). State-of-the-art of vehicular
traffic flow modelling. 215(4):283 – 303.
M. van den Berg, A. Hegyi, B. D. S. and Hellendoorn, J.
(2003). A macroscopic traffic flow model for inte-
grated control of freeway and urban traffic networks.
In Proceedings of the 42nd IEEE Conference on De-
cision and Control, pages 2774–2779, Maui, Hawaii.
Mauro, V. and Taranto, C. D. (1989). Utopia. In Pro-
ceedings of the 6th IFAC/IFIP/IFORS Symposium on
Control, Computers, Comunication on Transporta-
tion, pages 245–252, Paris, France.
Messmer, A. and Papageorgiou, M. (1990). Metanet: A
macroscopic simulation program for motorway net-
works. In Traffic Engineering and Control, volume 31,
pages 466–470.
Radecky, M. and Gajdos, P. (2008). Intelligent agents for
traffic simulation. In SpringSim ’08: Proceedings
of the 2008 Spring simulation multiconference, pages
109,115, San Diego, CA, USA. Society for Computer
Simulation International.
Robertson, D. and Bretherton, R. (1991). Optimization net-
works of traffic signals in real time-the scoot method.
40(1):11–15.
Xiao-Fan Zhi, Zhi-Cheng, L. S.-Y. Z. Y.-p. Z. (2008). An
intersection-centric priority algorithm for traffic sim-
ulation based on multi-agents. volume 1, pages 189–
194. IEEE Computer Society.
Zhang, F., Li, J., and Zhao, Q. (2005). Single-lane traffic
simulation with multi-agent system. In IEEE Con-
ference on Intelligent Transportation Systems, pages
1183 – 1187.
ICAART 2011 - 3rd International Conference on Agents and Artificial Intelligence
446