Simulation: Transactions of the Society for Modeling and Simulation International 1–14 Ó The Authors 2016 DOI: 10.1177/0037549716668259 sim.sagepub.com An agent-based model for simulatio
Trang 1Simulation: Transactions of the Society for Modeling and Simulation International 1–14
Ó The Author(s) 2016 DOI: 10.1177/0037549716668259 sim.sagepub.com
An agent-based model for simulation
of traffic network status: Applied to
Hanoi city
Abstract
In recent times there have been many agent-based simulation models proposed for transportation network simulation Intuitively, these models are applicable for the transportation simulation of modern cities in developed countries where the transportation network is very well organized: Roads are separated into lanes; most transportation occurs using vehicles; and almost all drivers respect the circulation rule However, these models are not suitable for developing coun-tries where the transportation network is unorganized The reasons for this are as follows: (1) there is no lane on the road; (2) most vehicles are motorbikes; and (3) not many drivers respect the circulation rule This paper introduces an agent-based model for transportation network simulation in which each form of transport is modeled as an agent exhi-biting full features of unorganized circulation behavior The model is designed for a large scale and instead of displaying the circulation for all individual modes of transport, the model displays only the status of the traffic network The simula-tion of circulasimula-tion is therefore considered as a background process The simulasimula-tion is launched and the results are obtained before being displayed This model is applied to the traffic network of Hanoi to analyze the hot or bottle neck points on the transportation network during rush hours in the city
Keywords
Traffic network modeling, transportation network simulation, simulation model, multiagent system
1 Introduction
Transportation network simulation is an active research
field that has attracted many researchers in recent times
Consequently, many models and tools have been proposed
to date Most of them are agent-based models: Each form
of transport could be modeled as an intelligent agent
which is able to observe other forms of transport and
obstacles to avoid and/or change its own speed and
direc-tion in order to reach its destinadirec-tion as fast as possible
The transportation network therefore could be modeled as
a multiagent system where each agent has some personal
attributes such as: physical size, goal (its destination to
go), destination route plan, etc Circulation behaviors also
include: go to the destination, avoid obstacles, find the
shortest or the fastest path, share traffic information to
other agents, etc There are many agent-based models
pro-posed in the literature.1–21
Technically, most of these models are intentionally
designed for an ideal circulation situation for developed
countries: roads are partitioned into lanes; the majority of
modes of transport are cars, buses, trains, etc., and the
drivers mostly respect the circulation rule (see our
sum-mary in Table 1)
However, these basic assumptions make these models unsuitable for developing countries where the transporta-tion network is unorganized because (see the Figure 1 of the traffic situation and the circulation culture of the Vietnamese):
most of the streets have no lanes and no one respects the rule that drivers have to follow only one lane on a street;
the majority of vehicles are motorbikes;
drivers do not always respect the circulation rule: they will move their vehicle anywhere as long as there is enough space for them
1
Posts and Telecommunications Institute of Technology, Hanoi, Vietnam
2
Vietnam National University in Hanoi, Hanoi, Vietnam
3
UMI UMMISCO 209 (IRD/UPMC), Paris, France
Corresponding author:
Manh Hung Nguyen, Faculty of Information Technology, Posts and Telecommunications Institute of Technology, Km10, Nguyen Trai, Ha Dong, Ha Noi, Vietnam.
Email: mhnguyen@ptit.edu.vn
Trang 2Following the theme of our previous work,22,23this paper presents a simulation model and tool applicable for devel-oping countries where the transportation network is unor-ganized, and it is then applied to the traffic situation and the circulation culture of Vietnam The model is also based
on multiagent systems, in which each mode of transport can be modeled as an intelligent agent which can observe other vehicles and obstacles to avoid and/or change its own speed as well as direction to reach its destination as fast as possible However, in order to increase the ability
to consider a large number of agents in the system, instead
of displaying all the vehicles and their trajectories, the pro-posed model shows only the status of the streets which represent the actual level of congestion for each street and for the overall network All of the remaining calculations for the vehicle agents are carried out in the lower level of the model
This paper is organized as follows: Section 2 presents our model Section 3 presents the modeling of the agents
in the model Section 4 presents the application of the model to simulate the traffic network of Hanoi Finally, Section 5 gives a conclusion and draws some perspectives for future work
2 Agent-based model for simulation of traffic network status
The model is divided into two main levels (Figure 2): First, the low level which contains mostly processing and calculations This simulates the real transportation network
Table 1 Summary of recent proposed models regarding the current Vietnamese circulation situation.
Figure 1 Differences in the circulation situation in developed
countries and Vietnam (a) Circulation in Europe (source:
www.pressoffice.pl) (b) Circulation in Vietnam (source:
www.sgtt.vn).
Trang 3throughout the day and then calculates the level of
conges-tion in the streets of the network This data could be saved
into storage and then displayed at a later time Second, the
high level, which plays only the role of displaying the
simulation data that is already calculated at the low level
and stored in storage This section presents the main steps
in both of the levels The modeling of vehicles will be
pre-sented in the next section
Step 1: Load GIS files
This step reads the input GIS (Geographic Information
System) data to create the road network The GIS data
rep-resents the realistic data from the real road network In the
input GIS data, each road is characterized by its:
ID: road identification;
name: road name;
direction: one way or dual ways;
permitted vehicles: types of vehicle which could
circulate on it;
capacity: the width or through put of road;
lanes: number of lanes
Step 2: Initiate agent position
This initiates the start place of the vehicles The
loca-tion of a vehicle is determined by a point within a zone
Thus the number of agents in a specific zone z is
deter-mined as follows:
n(z) = a I(z) s(z)
where a is the simulation ratio regarding the real size of
the population; I (z) is the density of the population in the
zone z; s(z) is the surface of the zone z; S is the overall
surface of the simulation zone (entry city); N is the total population of the simulation city
Step 3: Generate agent plans
This step creates plans for the vehicle agents A plan contains the following information:
start time: the start time to begin movement;
departure: the start place (longitude (x), latitude (y)) for the movement path;
destination: the finish place for the movement path;
max speed: the maximum speed of the vehicle;
type of vehicle: the type of vehicle on the road
A vehicle could have several plans with different desti-nations and start times
Step 4: Simulation
A vehicle is simulated by an agent which circulates based on its daily plans The actual position of an agent on the road is determined by two factors:
its movement path: this is dynamically determined
by an optimal algorithm (modeled in Section 3.1);
its speed: the actual speed of the agent, which could
be changed by the following rules:
– accelerate: when there is neither an obstacle nor a red light in front of it and its speed is not maximal yet;
– no change: when there are some obstacles in front of it such that it can not pass, or its speed
is already maximal;
– slow down: when there are many obstacles in front of it with decreasing speed
Step 5: Observation and sampling This step observes the actual throughput of streets in the network at some moments in time (called sampling time), and then saves the data into storage In our case study of the Hanoi traffic network, we categorise four kinds of road status: blocked, very slow, slow, normal speed
The threshold speed for each status can be estimated by using a Regular Increasing Monotone (RIM) linguistic quantifier Q (Zadeh24) In our case study we use Q(x) = x3 In Vietnam, the circulation policy and rule limit the speed in urban zones to 40 km/h for motorbikes, and 50 km/h for cars, taxis, trunks and buses The actual speed of a crowd is estimated as the speed of the slowest member in the crowd So we use the limiting speed of a motorbike as the reference speed (max speed in the fourth row of the Table 2) for our estimations Consequently, the threshold speed for each status is estimated as presented in Table 2:
blocked road: the speed is less than 1 km/h;
Figure 2 The two levels, including their main steps in the
proposed model.
Trang 4very slow road: the speed is between 1 km/h and 5
km/h;
slow road: the speed is between 5 km/h and 17 km/h;
normal road: the speed is higher than 17 km/h
Step 6: Display road/network status This step reads the
traffic status data for all of the streets from the storage
carried out in step 5 and then displays the data on the
net-work Each kind of traffic status is represented by a color:
red: the road (intersection) is currently blocked;
orange: the road is almost full, the movement of
vehicles is very slow;
yellow: the road contains many vehicles, the
move-ment of vehicles is slow;
gray or green: the road has a normal traffic, the
movement is normal
3 Agent modeling
This section presents the modeling of two kinds of agents
in the system: the vehicle agent and the traffic light agent
Each agent is classified using two parts: attributes, and
behaviors
3.1 Vehicle agent
This agent represents a transport such as a trunk, a bus, a
car (including taxi) or a motorbike All of these vehicles
are controlled by a driver Therefore, we do not need to
separately model drivers and can instead consider the
driver and his vehicle as a unique entity, called a vehicle
agent
3.1.1 Attributes A vehicle agent has the following
attributes
1 Name: name or type of vehicle
2 Length (denoted as l): the physical length of the
vehicle
3 Width (denoted as d): the physical width of the
vehicle
4 Max speed (denoted as ymax): the maximal speed which is allowed by law
5 Current speed (denoted as v): the actual speed of the vehicle at a moment in time
6 Max technical speed (denoted as ytech): the maxi-mal technical speed that a vehicle engine could reach
7 Safety front distance (denoted as df): the minimal distance to the nearest vehicle in front (or behind)
of it such that the movement is still safe This dis-tance is calculated as follows:
df=l y
where u is the minimal distance allowed between two consecutive vehicles when at rest
8 Safety beside distance (denoted as db): the mini-mal distance to the nearest left/right side of the vehicle such that the movement is still safe This distance is calculated as follows:
db=d y
9 Acceleration factor (denoted as a): the increase
of speed in a unit of time
10 Deceleration factor (denoted as b): the decrease
of speed in a unit of time
11 A set of circulation plans which represents the route plan of the vehicle in a daytime
The formulas for df and dbsay that the higher the actual speed of the vehicle, the greater the safety distance must
be between vehicles
3.1.2 Behavior In order to simulate the unorganized circu-lation activities such as that in the situation of Vietnam,
we need to distinguish two kinds of vehicle agent: obedi-ent and disobediobedi-ent The obediobedi-ent vehicle agobedi-ent is the one who respects completely the circulation laws This agent has the following activities
1 Find a path: finds a path to go to its destination This activity occurs when: either the agent starts a new plan; or it has to change the path when its cur-rent path is blocked somewhere
2 Observation: captures the changes in its environ-ment such as observing traffic lights and detecting other obstacles to avoid during circulation
3 Stop: stops at an intersection when the traffic light
is red or at the destination of its plan
4 Accelerate: increases its speed This activity occurs when: (1) there is enough space in front of
it to accelerate; and (2) its current speed could be
Table 2 Threshold speed for road status.
Threshold
speed (km/h)
Trang 5increased in a low speed regime The new speed
will accelerate to:
where yt, yt + 1 are the speed of the vehicle agent
at the simulation steps t, t + 1, respectively
5 Decelerate: decreases its speed This occurs when:
(1) there is some obstacles in front of it; or (2) it
wants to stop somewhere The new speed will
decelerate to:
The disobedient vehicle agent is the one who usually
breaks the circulation law This agent has some differences
in the following activities:
1 Accelerate: it increases its speed as long as there is
enough space in front of it and its speed is still lower
than the ytech The new speed will accelerate to:
where yt, yt + 1 are the speeds of the vehicle at the
simulation steps t, t + 1, respectively
2 Decelerate: the same principle as with the obedient
agent
The transition among activities of a vehicle agent is
pre-sented in Figure 3: When the time is the same as the start
time of a plan, the vehicle agent starts to move Firstly, it
finds a path to go its destination During movement, it
cap-tures the occurrence or the change of status of three kinds
of object: the traffic light, the destination, and the obstacle
At an intersection, it observes the change of traffic light color: if the light is red it will stop; otherwise, it will con-tinue to move At any point on the path, it will accelerate
if there is no obstacle in the street and its actual speed y is still lower than the allowed speed ymax In contrast, it will decelerate if there are some obstacles or its speed y is already higher than the allowed speed ymax(for the case of
an obedient vehicle agent) Otherwise, it continues to travel with the same speed It could re-find the path if it was blocked somewhere If it is already at the destination,
it stops
3.1.3 Dynamic optimal path finding There have been many models proposed recently to optimize the routing of the whole traffic network by searching for the best path for each individual such as the models by Deng et al.,25Hua and Pei,26Nannicini et al.,27Efentakis et al.,28This paper introduces an algorithm to dynamically optimize the rout-ing at the system level of a transportation network In this algorithm, each individual will be recommended to follow
a path which depends on the current traffic capacity and the user preferences such that the overall throughput of the traffic network is maximized as well as the user prefer-ences being satisfied
Construction of the graph for a traffic network The graph for a given traffic network will be created as follows:
1 Each intersection forms a node of the graph
2 Each road forms an arc with the same direction If
a long road has many segment points where the drivers could change direction, then each segment
Figure 3 Behavior of the transport agent.
Trang 6of road (between two consecutive segment points)
will form an arc with the same direction
3 Let yavg be the average speed of circulation
(yavg= average(yk), for8k on the same road from
node i to node j), lengthijbe the length of the road
from node i to node j, then the necessary time tijto
pass through the road from node i to node j will be
estimated as follows:
tij=lengthij
In fact, the weight of an arc could be a value which is
pro-positional with one of two options: (i) the length of the
corresponding road; (ii) the necessary time to pass the road
corresponding to the arc We use the second approach
because it takes into account the dynamic nature of the
traffic network whereas the first one is always static
Therefore, we call the best path from an original point to
an end point the fastest path instead of shortest path
Static fastest path
The objective of this step is to estimate the fastest path
for the ideal circulation conditions: we can drive with
maximum allowed speed on all roads in the network:
y= ymax, so yavg= ymax With regards to Equation (7),
when yavg= ymax, then tij becomes constant That is why
we call this the SFP - Static Fastest Path
User preference
We aim to take into account the variations in time
con-straints among drivers by modeling the user preference
Thus, the preference on the time constraint of a driver is
represented by a number K, K 1: The maximal
accepta-ble time of this driver is K SFP (K times the static fastest
path in the ideal conditions) The bigger K, the less
impor-tant the user places on time; and vice versa, the smaller K,
the more strictly time is constrained for the user In
respecting the user preferences, the dynamic fastest path
has to be shorter than K SFP This idea also helps us to
prevent too many people from being recommended to
fol-low the same road because their preferences are different
regardless of it they have the same origin and end point
Dynamic path optimization algorithm
Let o2 G be the original node, e 2 G be the destination
node, H G be the set of visited nodes, U G be the set
of un-visited nodes, d(i, j) be the fastest time from node i
to node j and P(i) = j represents the node j that is the node
just before node i on the fastest path from the original node
o to node j The algorithm is as follows:
1 Initiation Put node o into H, d(i, j) = tij with tij
estimated from Equation (7), P(i) = 1
2 Repeat Considering all nodes j2 U where there is
at least one node l2 H which has a direct arc from
k to j and d(o, l) + tlj4 K SFP:
if d(o, j) d(o, l) + tlj then: P(j) = l and d(o, j) = d(o, l) + tlj;
put j into G, remove j from U;
if e is already in G or U is empty then stop
3 Constructing of the fastest path From P(e), find P(P(e)) until o is reached Reverse this series and we will obtain the track of the fastest path from
o to e
3.2 Traffic light
This agent represents a traffic controller at an intersection
of the traffic network This agent can not move It only has the ability to change the color of the traffic light to route the traffic
3.2.1 Attributes A traffic light has the following attributes:
1 A set of control directions: These are all directions which are designed at an intersection (e.g., Figure 4 presents four control directions for an intersection)
2 Each control direction has the following:
green duration (denoted dg): This is an inter-val of time During this interinter-val, the light is green and the vehicles can go through the intersection
red duration (denoted dr): This is an interval
of time During this interval, the light is red and the vehicles have to stop
minimal green duration (denoted MinT): the green duration can not be lower than this threshold to avoid the case that the light color changes too quickly to follow
maximal green duration (denoted MaxT): the green duration could not be longer than this threshold to avoid the case that the remaining control directions have to wait too long
time counter (denoted counter): this agent changes the color of the light when the value of this variable reaches the green or red duration 3.2.2 Behavior A traffic light has three behaviors:
1 Change to green: this activity occurs when the cur-rent light is red and the counter value is equal
to dr After changing to green, the counter value is reset to zero
2 Change to red: this activity occurs when the light
is green and the counter value is equal to dg After changing to red, the counter value is also reset to zero
3 Optimization of green/red time: this agent dynami-cally updates the dg and dr to optimize the traffic routing at its intersection The algorithm will be presented in the next section
Trang 7The transition among activities of a traffic light agent is
presented in Figure 5 Firstly, it initiates the value of dr,
dg, and the color for each of the control directions Then
the transition between change to red and change to green
is controlled by the value of counter, by comparing it to
the value of drand dg During this transition loop, the
func-tion of Optimizafunc-tion of green/red time is also evaluated
3.2.3 Dynamic optimal routing for traffic light There are
many models proposed in recent times to optimize the
routing at an intersection of a transportation network, such
as the models by Burguillo-Rial et al.,29 Royani et al.,30
Mehan and Sharma,31 Popescu et al.,32 Gershenson and
Rosenblueth.33This paper introduces an algorithm to
dyna-mically optimize the routing at an intersection of a
transportation network In this algorithm, the next green time of a direction is estimated based on the rate of modes
of transport which pass through the intersection during the last green time
In the case of an independent light direction, the main steps in the algorithm are the following:
1 The green light time must not be lower than a min-imal threshold MinT , and not higher than a maxi-mal threshold MaxT
2 In all cases, the light is set to green if the destina-tion direcdestina-tion still remains for the mode of transport
3 Let nt1, nt be the number of modes of transport which passed the green light during the (t 1)th, tth green light times, respectively
4 Let dtbe the green light time at t
5 The green light time at (t+1) will then be:
dt + 1= min max (dt nt
ð8Þ
In the case of several light directions, the main steps in the algorithm are as follows:
1 The green light time must not be lower than a min-imal threshold MinT , and not higher than a maxi-mal threshold MaxT
2 In all cases, the light is set to green if the destina-tion direcdestina-tion remains for the mode of transport
3 Let k be the number of control directions at the intersection
4 Let nt(i) be the number of modes of transport which passed the green light, for the control direc-tion i, during the tth green light time
5 Let dt(i) be the green light time at t of the control direction i
6 The green light time at (t + 1) will be:
minj = 1(nt(j)), MaxT
ð9Þ
7 The red light time at (t + 1) will be:
dt + 10 (i) = Xk
j = 1, j6¼i
4 A case study: Simulation of the traffic network of Hanoi city
This section presents a case study in which the proposed model is applied to simulate the traffic network of Hanoi (the capital of Vietnam)
Figure 4 Four control directions at an intersection.
Figure 5 Behavior of the traffic light agent.
Trang 84.1 Simulation setup
This section presents the initiation of the agent population
and the agent parameters and the construction of the agent
plan
4.1.1 Initiation of agent population The position of agents is
initiated based on the realistic population distribution of
Hanoi, grouped by districts (Table 3; the statistical
num-bers were collected from multi sources in 2013) For
instance, if we take the simulation rate as 1:100, there will
be about 23,000 agents in the nine central districts In
which there will be about 2200 agents living in Ha Dong
district, and 2500 other agents living in Thanh Xuan
dis-trict, etc
4.1.2 Initiation of vehicle parameters The initial conditions
for the vehicle parameters is presented in Table 4 The
val-ues of size, max technical speed, accelerate factor, and
decelerate factor for each kind of vehicle are assigned
based on the majority of vehicles which circulate in
Vietnam The value of max speed, and minimal distance
allowed are defined based on the Vietnamese circulation
law for urban zones
4.1.3 Construction of agent plans The data about the
distri-bution of buildings in the city such as offices, hospitals,
schools, universities, tourist sites, commercial centers,
manufactures, etc is loaded from a GIS file (Figure 6)
This is the input data used to build the vehicle agent plan:
its home position, its jobs will determine an office or a
school For instance, consider a woman officer who lives
in Thanh Xuan district She uses her car to take her son to
school before 7 a.m at Kim Lien quarter Then, she goes
to her office in Ba Trieu street before 8 a.m At the end of
day, she leaves her office at 4:30 p.m and gets to her son’s
school to collect him at 5 p.m after which the mother and
son go back home together (Figure 7)
4.2 Results
This section presents some results of the simulation con-sidering several aspects: runtime, validation of Vietnamese circulation behavior, displaying the traffic network at dif-ferent levels, analyzing the statistics, and the validation of the dynamic optimum of path finding
4.2.1 Simulation runtime The simulation runtime depends
on the configuration of the running machine, as depicted
in Table 5 The chosen simulation rate is 1:100 This means that the number of vehicle agents is about 23,000 Consequently, the simulation time on a normal PC, for a
Figure 7 Representation of an individual’s plans in XML format.
Table 3 Population distribution by central districts.
quarters
Surface (km2) Population
(1000 people)
Figure 6 Distribution of buildings in Hanoi.
Table 4 Initial value of vehicle agent’s parameters.
Max speed (max) 40 km/h 50 km/h 50 km/h Max technical speed 120 km/h 150 km/h 150 km/h
Accelerate factor (α) 0.5 m/s2 0.5 m/s2 0.5 m/s2 Decelerate factor (β) 0.5 m/s2 0.5 m/s2 0.5 m/s2
Trang 9whole day (24 h) of simulation, is about 15 hours.
Meanwhile, the simulation time on a server with high
con-figuration and performance is about 2 hours Independent
of the machine configuration, the display time in both
cases is only about 3 minutes, including the delay time
after each sample status display The display time is much
less than the simulation time because it simply reads the
simulation results (which are obtained from a long
simula-tion time and already saved into a file) and then displays
them on the interface
These results confirm the advantage of our approach by
separating into the two levels: simulation and display
Despite the length of the simulation time and the
complex-ity of the simulation system, the display time could be
short enough to display as a real-time simulation
4.2.2 Validation of Vietnamese circulation behavior In order to
validate the Vietnamese circulation behavior in the model,
we consider the following scenario:
track the circulation path of an obedient driver at a
low traffic moment;
track the circulation path of a disobedient driver at
a high traffic moment;
display the two tracked paths on the passed streets
to see their differences
The results are presented in Figure 8 There is a big
dif-ference between the two tracked paths The path of the
obedient driver is much more smooth than that of the
dis-obedient driver The path of the disdis-obedient driver is less
structured because the driver adopted the Vietnamese
cir-culation behavior during high traffic moments: he did not
respect the circulation law, the signal of the traffic lights,
as well as the circulation lane He moved forward as long
as there was enough space in front of him to do so
This path illustrates the circulation behavior of many
Vietnamese drivers in the high traffic moments which is
modeled in the proposed model
4.2.3 Displaying of traffic at the local level This model also
enables us to show the traffic situation on a smaller scale
for the traffic network, such as the traffic in a particular street, at an intersection, or at any hot point of the traffic network For instance, the traffic at an intersection is pre-sented in Figure 9 for several situations: the traffic in low traffic (at 6 a.m.) or a high traffic moment (at 7:20 a.m.) and the traffic when the traffic lights work or do not work
It is easy to see that, with the same traffic conditions, the circulation when the traffic lights work is better than that when the traffic lights do not work The circulation in
a low traffic moment is better than that in rush hour The circulation in rush hour without traffic lights (Figure 9(d) simulates completely the real traffic situation depicted in Figure 1(b)
4.2.4 Displaying of traffic status at the overall level The results of traffic network status are presented in Figure 10
At 6 a.m., there is no red or orange street and there are only some streets in yellow because it is not a rush hour yet At 7:20 a.m., it is a rush hour as there are at least five
Table 5 Simulation configuration and runtime.
1 day simulation time ∼ 15 hours ∼ 2 hours
1 day display time ∼ 3 minutes ∼ 3 minutes
Figure 8 Circulation path for the obedient and disobedient drivers (a) Obedient driver’s path at 6:00 a.m (b) Disobedient driver’s path at 7:20 a.m.
Trang 10Figure 9 Traffic, in local view, at different moments during the
day (a) 6:00 a.m., with traffic lights (b) 6:00 a.m., without traffic
lights (c) 7:20 a.m., with traffic lights (d) 7:20 a.m., without
traffic lights.
Figure 10 Traffic status, in global view, at different moments during the day (a) 6:00 a.m (b) 7:20 a.m (c) 12:00 p.m.
(d) 06:00 p.m.