Simulation of Crowd Evacuation scenarios using NetLogo
Simulation of crowd evacuation scenarios using
NetLogo
Federico D’Amato
March 18, 2016
1 Introduction
The aim of this work is to model the evacuation of a group of people from a
simple area. The area to evacuate is represented by a simple grid; the people
flow from a fixed number of entry-points towards a fixed number of exit-points.
In pedestrian simulation, most modellers focus on the locomotion level, that
is, how to get from one place to another. However, pedestrian behaviour and
motion does not only depend on the locomotion. It is important to include
social behaviours which impact the results of the simulation. In this work we
include two main social behaviours:
• Altruism
• Conformism
With altruism we denote the propension of an individual to help a disadvan-
taged person (like a disabled). In [1] this is referred as “helping behaviour”.
We denote conformism as the tendency of a person to follow the most common
behaviour of the others, i.e. to go in the most crowded areas of the grid. Con-
formists people tend to agree with the average opinion of their neighbors while
anti-conformists tend to disagree [2].
In this work we distiguish between two types of pedestrians: normals and dis-
ableds. Each class of pedestrians has some characteristic attributes, such as the
moving speed (obviously normal pedestrians are faster than the disabled ones).
The implementation and all the simulations are performed using NetLogo 5.3
[3], which is “a multi-agent programmable modeling environment”.
1
Figure 1: The model implemented in NetLogo. The left picture is a symmetric
scenario, while the right one is asymmetric. In this example the grid is a 5 × 5
grid and each road is 4 patches large.
2 Model description
In NetLogo time is discretized in ticks. In our model we also use discrete space.
Every pedestrian is represented by a turtle.
2.1 NetLogo implementation & parameters
In this section we briefly describe how the model is implemented in NetLogo
and which parameters we decide to include. The following parameters change
the grid:
• n-roads: this will affect the size of the grid that will be (n-roads ×
n-roads)
• roads-size: how large are the roads (in # of patches)
• only-2-entries?: choose between a grid with 2 entries or with (2×
n-roads) entries
• only-2-exits?: choose between a grid with 2 exits or with (2× n-roads)
exits
• two-lines-entries?: switch between single-patches entry-points and double-
patches entry-points
• add-obstacles?: choose between a symmetric grid or asymmetric grid
In Figure 1 there are two different examples of grid with different parameters.
2
Figure 2: Sliders used to change the behavioural parameters in NetLogo
Through the sliders shown in Figure 2 we can change other parameters that
affect the behaviour of the pedestrians in the simulation:
• normal-speed: the speed for the normals pedestrians
• disabled-speed: the speed for the disableds pedestrians
• entry-ratio: the entry ratio for each entry-point
• global-altruism: the initialization value for the parameter altruism of
each normal pedestrian
• global-conformism: the fraction of conformists pedestrians
• conformism-radius: the fixed radius (in # of patches) used in the eval-
uation of the non-conformist behaviour
• disabled-ratio: the fraction of disableds pedestrians
Figure (2) also shows the parameters set to the default values.
In our model, we define two breeds of turtles: normals and disableds. The
main characteristics of these two breeds are:
• normals are faster than disableds
• normals are more common than disableds (we set this ratio to 20 : 1)
• normals can help disableds
• normals can be conformists or not, while disableds are conformists
by design
Every pedestrian has the following two attributes:
3
• speed ∈ (0, 1]
• altruism ∈ [0, 1]
• conformist? ∈ {true, false}
2.2 Arrival process
The arrival process at the i-th entry-point is geometrically distributed, i.e. we
generate a pedestrian at entry-point i at the k-th tick if the entry-point is free
and
x(k) ∈ X ∼ U[0, 1] < λi (1)
where U[0, 1] is the uniform distribution and λi is the entry-ratio of entry i.
2.3 Moving behaviour
In our model, in one tick one pedestrian can move only by one position, chosen
with some criterion in his neighborhood (we consider cross-like neighborhoods).
At each tick, every pedestrian decides whether to move or not according to his
speed. Each pedestrian’s speed express the probability to move in one tick.
The moving behaviour is explained in Algorithm 1.
Algorithm 1: Moving behaviour, i-th pedestrian, k-th tick
1 if # free patch in my neighborhood > 0 then
2 choose y(k, i) ∈ X ∼ U[0, 1]
3 if y(k, i) < speedk
i then
4 Move to a free patch in the neighborhood according to some
criterion
2.4 Altruism
At each tick, every normal turtle decides whether to help or not a disabled
in his neighborhood. The helping behaviour is explained in Algorithm 2.
Instruction 7 of Algorithm 2 has 2 meanings: on one hand, it means that each
normal pedestrian can help at most one disabled; on the other hand it means
also that if a pedestrian choose not to help a disabled at time k, he will not
help anybody else in the future.
We will use the term altruists for those pedestrian who execute Instruction 5
at least one time, while we will call non-altruists the others.
2.5 Conformism
The moving strategy used in Instruction 4 of Algorithm 1 strongly depends on
the attribute conformist? of the pedestrian.
4
Algorithm 2: Helping behaviour, i-th pedestrian, k-th tick
1 if altruismk
i > 0 then
2 if # disableds in my neighborhood > 0 then
3 choose a(k, i) ∈ X ∼ U[0, 1]
4 if a(k, i) < altruismk
i then
5 Help a random disabled j in my neighborhood
6 speedk+1
i =
speedk
i +speedk
j
2
7 altruismk+1
i = 0
2.5.1 Conformist behaviour
Conformists pedestrians aim to the nearest exit-point regardless of how crowded
the path is. The conformist behaviour is explained in Algorithm 3.
Algorithm 3: Conformist behaviour, i-th pedestrian, k-th tick
1 Let nearest-exitk
i the nearest exit
2 Compute headingk
i as the angle between me and nearest-exitk
i
3 for each free patchj in my neighborhood do
4 Compute heading-patchj as the angle between patchj and
nearest-exitk
i
5 Let best-patchk
i = arg minj |headingk
i − heading-patchj|
6 Move to best-patchk
i
2.5.2 Non-Conformist behaviour
Non-conformists pedestrians have a more complex behaviour. They try to avoid
overly crowded paths; if the path to the nearest exit is too crowded, a non-
conformist pedestrian change his mind and heads to another exit. The non-
conformist behaviour is explained in Algorithm 4.
Instruction 5 of Algorithm 4 deserves some explanations. We have two condi-
tions:
• nnearest > α express the fact that the path between the pedestrian and
the nearest exit-point is too crowded. α is a parameter of the model.
• nsecond < nnearest express the fact that the second exit-point in less crowded
than the nearest exit-point.
If these two conditions are satisfied, the non-conformist pedestrian heads to the
second nearest exit-point instead of the nearest one.
5
Algorithm 4: Non-Conformist behaviour, i-th pedestrian, k-th tick
1 Let nearest-exitk
i the nearest exit
2 Let alternative-exitk
i the second nearest exit
3 Compute nnearest as the number of pedestrian between me and
nearest-exitk
i in a fixed radius
4 Compute nalternative as the number of pedestrian between me and
alternative-exitk
i in a fixed radius
5 if (nnearest > α) and (nalternative < nnearest) then
6 Compute headingk
i as the angle between me and alternative-exitk
i
7 preferred-exitk
i = alternative-exitk
i
8 else
9 Compute headingk
i as the angle between me and nearest-exitk
i
10 preferred-exitk
i = nearest-exitk
i
11 for each free patchj in my neighborhood do
12 Compute heading-patchj as the angle between patchj and
preferred-exitk
i
13 Let best-patchk
i = arg minj |headingk
i − heading-patchj|
14 Move to best-patchk
i
6
0 100 200 300 400 500 600 700 800 900 1,000
0
0.2
0.4
0.6
k
Fi,j(k)
Entry 1
Exit 1
Exit 2
0 100 200 300 400 500 600 700 800 900 1,000
0
0.5
1
k
Fi,j(k)
Entry 2
Exit 2
Figure 3: Cumulative distribution function of sojourn time for different pairs
Entry-Exit
3 Experiments
3.1 Default settings
In all the following experiments we use the default parameters values as shown in
Figure 2. The model studied is the right one of Figure 1, that is an asymmetric
model with two entry-point and two exit-points, 5 roads each of which is 4
patches large. In our experiments we compare the results obtained from a single
simulation with the results obtained as the average over 10 different simulations.
7
3.2 Numerical results
Let i an entry-point and j an exit-point, we can define the cumulative distribu-
tion function of the sojourn time of pedestrians as:
Fi,j(k) = P {exit at Exitj with sojourn time ≤ k | enter at Entryi} (2)
Figure 3 shows Fi,j(k) for all the Entry-Exit combinations. As we can see from
Figure 3, using the default settings, pedestrians that enter from Entry 2 always
exit in Exit 2. On the other hand, pedestrians that enter from Entry 1 exit both
from Exit 1 or Exit 2. In particular, with the default settings, we have:
P1,1 = P {exit at Exit1| enter at Entry1} = 0.574
P1,2 = P {exit at Exit2| enter at Entry1} = 0.426
P2,1 = P {exit at Exit1| enter at Entry2} = 0.000
P2,2 = P {exit at Exit2| enter at Entry2} = 1.000
(3)
From now on, we try to characterize how Pi,j changes with different values for
the model’s parameters.
The first parameter under exam is entry-ratio. As we can see in Figure
4, this parameters strongly affects the value of P1,1: for near-zero values of
entry-ratio, P1,1 is high, i.e. pedestrians that enter from Entry 1 have an
high probability to exit from Exit 1. As the entry-ratio increases, P1,1 de-
creases; this represents the fact that when our model becomes too crowded,
non-conformists pedestrians head to the secondary exit more and more often.
The second parameter that affects the value of P1,1 is conformism. In Figure
5 we plot P1,1 as a function of conformism, using three different roads-size
in the model. As we can see in Figure 5, in a model with roads-size = 2,
conformism doesn’t affect the value of P1,1. With larger values of roads-size,
however, we can notice some sort of linear dependency between P1,1 and
conformism. This is caused by the fact that, increasing the number of
conformists pedestrians, we increase the number of pedestrians that choose
the nearest exit (i.e Exit 1) regardless of how crowded the path is.
Another important measure of our simulations is the average sojourn time of
the pedestrians, that is the time taken from the pedestrians to pass through
our model. Figure 6 shows how the average sojourn time changes with the
entry-ratio. The first consideration to be done is that the average sojourn
time is larger for the pedestrians that enter from Entry 2. Using low values
of entry-ratio, the sojourn time is relatively small. As the entry-ratio
increases, the sojourn time increases; however, when the entry-ratio becomes
larger than 0.2, it becomes practically constant.
The most obvious parameter to take into account when we study the average
sojourn time is the speed of the pedestrians. Since the movement of pedestri-
ans is geometrically distributed with rate speed, the expected value of sojourn
time for the i-th pedestrian (not considering the other factors such as traffic or
altruism/conformism) is:
E[S] =
d
speed
(4)
8
0 0.2 0.4 0.6 0.8 1
0.55
0.6
0.65
0.7
0.75
0.8
0.85
Entry ratio
P1,1
Entry 1
Exit 1
Exit 1 (10 attempts)
Figure 4: Fraction of turtles that enter from Entry1 and exit in Exit1 for dif-
ferent values of the entry-ratio
9
0 0.2 0.4 0.6 0.8 1
0.4
0.45
0.5
0.55
0.6
0.65
0.7
Conformism
P1,1
Entry 1
Exit 1 (roads-size=2)
Exit 1 (roads-size=2, 10 attempts)
Exit 1 (roads-size=4)
Exit 1 (roads-size=4, 10 attempts)
Exit 1 (roads-size=6)
Exit 1 (roads-size=6, 10 attempts)
Figure 5: Fraction of turtles that enter from Entry1 and exit in Exit1 for dif-
ferent values of the conformism and roads-size
10
0 0.2 0.4 0.6 0.8 1
200
220
240
260
280
300
320
340
360
380
Entry ratio
Averagesojourntime(#ticks)
Entry 1
Entry 1 (10 attempts)
Entry 2
Entry 2 (10 attempts)
Figure 6: Average sojourn time (in # of ticks) of pedestrians that enter from
Entry1 and Entry2 for different values of the entry-ratio
11
where d is the (fixed) distance between Entry 1 and Exit 1 (or Entry 2 and
Exit 2) and speed is the average speed of the pedestrians. Figure 7 shows that
using a low value of the entry-ratio, the average sojourn time of pedestrians
is nearly E[S]. When we set the entry-ratio to an higher value, the average
sojourn time increases: this happens because of the traffic in the area caused
by the high entry-ratio.
12
0.2 0.4 0.6 0.8 1
100
200
300
400
Normal Speed
Averagesojourntime(#ticks)
Entry 1 (entry-ratio = 0.001)
Entry 2 (entry-ratio = 0.001)
E[S]
0.2 0.4 0.6 0.8 1
0
200
400
600
800
1,000
1,200
1,400
1,600
Normal Speed
Averagesojourntime(#ticks)
Entry 1 (entry-ratio = 1.00)
Entry 2 (entry-ratio = 1.00)
E[S]
Figure 7: Average sojourn time (in # of ticks) of pedestrians that enter from
Entry1 and Entry2 for different values of normals speed and entry-ratio
13
4 Conclusions
In this work is presented a Netlogo implementation of a variety of crowd evac-
uation scenarios. The model is highly customizable, in terms of the structure
the area to evacuate and in terms of the pedestrians’ behaviours. In particular,
we have implemented two social behaviour: altruism and conformism. Thanks
to the flexibility of the model, we were able to study how this two behaviours
can affect the values of:
• the cumulative distribution function of the sojourn time for all the en-
try/exit pair
• the probability of the pedestrian to exit using an exit-point instead of
another one
• the average sojourn time of the pedestrians in the area
Even if this work presents a reasonable set of experiments, more tests can be
done using different default settings. In particular it might be interesting to use
different types of asymmetries in the grid.
References
[1] I. von Siversa, A. Templetonc, G. K¨ostera, J. Druryc, A. Philippidesc, Hu-
mans do not always act selfishly: social identity and helping in emergency
evacuation simulation, 2014.
[2] F. Bagnoli, R. Rechtman, Bifurcations in models of a society of reasonable
contrarians and conformists, 2015.
[3] Netlogo, http://ccl.northwestern.edu/netlogo/, 1999.
14