Royal Institute of Technology
Bachelor’s Thesis
An optimal control approach for rescue process during a fire disaster
Author:
Xiao Chen xiao2@kth.se Fredrik Isaksson freisa@kth.se
Supervisor:
Xiaoming Hu Yuecheng Yang
May 21, 2014
Abstract
This thesis aims to construct a realistic model of a leader led evacuation during a fire. By introducing a leader-follower idea we formulate this as a optimization problem. This is then attempted to be solved by optimization methods and some heuristic methods. The achieved solution can then be studied and analysed for inspiration in decision making in real life situations.
To reach these goals, the followers is formulated with a ’social force’ model with a desired direction towards the leader. The leader in the model represent the fireman in a real situation and how he and his decision making is affected by three different kinds of civilians; children, adults and elderly. By constructing a map over the feasible area we define obstacles and the danger in the building. Using these real world constrains we formulate an optimal control problem for the leaders path where the danger and the distance to the exit for all agents are parameters to be minimized. The problem will be hard to solve analytically and thus local minima’s and numerical solutions will be the primary focus.
Sammanfattning
I detta arbete syftar vi på att konstruerar en realistisk model av en brandsituation, där räddning av civila tas i beaktande. Genom införande av en leader-follower idé, formulerar vi det till ett optimeringsproblem. Vilken vi då försöker lösa med optimerings metoder och eventuellt med vissa heuristiska metoder. Den resulterande lösning kan då bearbetas och analyseras för inspirerande av handlande i verkliga situationerna.
För att nå fram till våra målsättningar, introducerar vi en följare med hjälp av den så
kallade ’social force’ modelen. Leadaren i simuleringen representerar en brandmanen
i en verklig situation som påverkas av tre olika typer av civila, nämligen barn, vuxna
och äldre dvs följarna. Genom att konstruerar en kartan över platsen där brand sker,
fastställer vi hinder och faran över karta. Med all realisering i hand formulerar vi opti-
merings problemet där framförallt faran och avståndet till utgången ska minimeras för
alla agenter. Problemet kommer att bli svårlöst analytiskt. För att komma fram till
en lösning kommer vi därför att studera locala minimum och numeriska lösningar till
problemet.
Acknowledgements
We would like to thank our patient, very helpful and insightful supervisor Yuecheng Yang at the department of Optimization and Systems Theory at the Royal Institute of Technology for his advise and help in performing this project.
We would also like to thank the head examiner Professor Xiaoming Hu for his valuable insight into the modeling process and for making the project possible to conduct.
ii
Contents
Acknowledgements ii
Contents iii
List of Figures v
List of Tables vi
1 Introduction 1
1.1 Introduction to the thesis . . . . 1
1.1.1 The environment . . . . 1
1.1.2 The agents . . . . 2
1.2 Relation to real situations . . . . 2
2 The mathematical model 4 2.1 Modeling the followers movement . . . . 4
2.1.1 The followers . . . . 4
2.1.1.1 Sensing ability of follower agent . . . . 5
2.1.1.2 The desired direction . . . . 6
2.1.1.3 The memory ability of agents . . . . 7
2.1.1.4 The follower-follower functions . . . . 8
2.1.1.5 The follower-obstacle functions . . . . 9
2.1.2 Danger and obstacles . . . . 10
2.2 Modeling the leader . . . . 10
2.2.1 Approximate leader . . . . 11
3 The Simulation 13 3.1 The followers - SIMULINK . . . . 13
3.1.1 The room . . . . 14
3.2 The leader - Optimization . . . . 15
3.2.1 Optimization algorithms . . . . 16
3.2.2 Simplified model . . . . 16
4 Results & Discussion 17 4.1 Results of the follower simulations - are they realistic? . . . . 17
4.2 The optimization and the path of the leader . . . . 17
4.2.1 The complete model . . . . 18
4.2.2 Using the simplified model . . . . 20
iii
Contents iv
5 Conclusions 23
5.1 General conclusions . . . . 23
5.1.1 Using a simplified model for optimization . . . . 23
5.1.2 The usefulness of the results . . . . 23
5.2 Possible further works . . . . 24
List of Figures
2.1 Sight range . . . . 6
3.1 The simulation room . . . . 14
3.2 Danger in the room . . . . 15
4.1 The inital paths . . . . 18
4.2 Danger, Complete optimization . . . . 20
4.3 Danger, simplified optimization . . . . 21
4.4 Difference in paths . . . . 22
v
List of Tables
4.1 Comparison of the objective function for the complete model. . . . . 19 4.2 Comparison of the objective function for the simplified model. . . . . 21
vi
Chapter 1
Introduction
1.1 Introduction to the thesis
The evacuation of buildings during a fire is a high stakes situation where bad decisions can lead to death or serious injurious. Simply heading towards the closest exit at maximum speed has been shown to be a sub optimal strategy for evacuating a building due to congestion at bottlenecks.[1] Doing practical experiments in this field is also something that is very hard to conduct ethically. Successfully modelling and efficient evaluation of these situations is thus highly desirable which is also reflected in the fact that quite a great deal of work has been conducted in the field of evacuation simulation and strategy.[1–8]
Much of the work has however been focused on the modelling of the agents and not the path of a rescuer.[1–4, 8] This thesis will thus focus on using the model to find a path for a rescuer.
Most models try to find the fastest way to evacuate a building[1, 9]. However the fastest path is not necessarily the safest. The main goal of this thesis was aimed to reach the minimized danger of all people in the evacuation process by controlling the fireman to direct the paths of all individuals in order to avoid not only death but also serious injuries caused by proximity to fires. The realization of such goals is achieved basically by formulating it as an optimal control problem with the fireman’s dynamics as a control input and the response from the other individuals is modeled in a individual and realistic sense.
1.1.1 The environment
Fire disaster is a complex system with involvement of many elements. Situations may differ a lot due to the various types of conditions. Thus a workable problem require the
1
Chapter 1. Introduction 2
simplification and limitation of the reality. In this thesis work, the problem is limited to evacuation of the ground level of buildings. Although other buildings could be ap- proached in a similar way to our approach by making some small extensions. Three main concepts are introduced to describe the environment. The first is impassable objects that represent walls and other hard to move through areas such as an area filled with tables.
The second part is exits, they represent doorways out of the building or large windows.
Finally an artificially designed field is used over the entire building that describes the danger at each location to realize the hazardous effects of elevated heat levels and smoke.
1.1.2 The agents
In the model the people and fireman involved is to be represented mathematically. The idea of an agent system is used and two types of agent are introduced, the followers and the leader. The followers in the model correspond to ordinary people with little knowledge of fire situations and the area. The leader in the model could be related to a fireman or other evacuation leader that is directing the other people in the building with total knowledge of the environment.
Since different people are capable of helping themselves to different extents, modelling each agent with its own personal properties is necessary. An agent based approach is well suited for this need.[10] The reason of modelling differences in the agents is not only for physical characteristics such as speed but also for more ethical characteristics by assigning weights to the amount of danger experienced differently for each agent. The human’s need to accelerate in order change its velocity and direction is also taken into account, an agent can not turn instantly. This is done using a second order integrator system for the dynamics of the agents.
1.2 Relation to real situations
When constructing a model one has to consider what information is available to each agent at every step. The model tries to keep the information available to the followers as realistic as possible. They make decisions based on their own frame of reference and have a limited sight radius.
The information available to the leader however is quite exaggerate since the leader
has global information of the building including positions of agents and how the danger
field looks like at every position. This could be slightly feasible given that the leader
is extremely well prepared and has studied how a fire would develop in different areas
Chapter 1. Introduction 3
as well as having a total overview of the building (through surveillance cameras). This
situation is quite unrealistic and further extensions of this work could look at limiting
the leaders information and replacing it with statistical approximations of the area.
Chapter 2
The mathematical model
In this chapter the movement of the followers is realized and described as well as the optimal control problem for the leader’s movement is derived. Models for pedestrian behavior in evacuation situation have been studied quite a lot in previous works. [3, 4, 11–
13] An agent based model will be used to simplify the distinction between different agents.
[10, 14]
2.1 Modeling the followers movement
The dynamics governing the followers movement make use of the Social force model[1]
formulated by Helbing. It works by introducing virtual forces acting on each agent in order to simulate social behavior.
2.1.1 The followers
The system of concern contains n follower agents, the position and velocity of the agent i is defined as following
Definition 1. The position of the i:th follower is denoted
x
i, i = 1, 2, 3, · · · , n (2.1)
Definition 2. The velocity of the i:th follower is denoted
v
i, i = 1, 2, 3, · · · , n (2.2)
4
Chapter 2. The mathematical model 5
A certain individual does not walk into other people or walls but tries to avoid such things, the followers should thus be affected by obstacles, other followers, exits and leaders. Realistic movement also dictates that a person can not change his or her velocity instantaneously, we will thus model the movement using a second order system. This gives rise to the following definition.
Definition 3. The system governing the movements of the followers is given by
∂x
i∂t =v
i(2.3)
∂v
i∂t = X
j6=i
F
i,f ol(x
i, x
j) +
W
X
j=1
O
i,obs(x
i, w
j)+ (2.4) + v
i,de
i,d(x
0) − αv
ix
i(0) =x
i,start(2.5)
v
i(0) =0 (2.6)
Where w
jis the position of an obstacle.
This definition is the general structure of the social force model[1] and it allows for specific adaptions in the choices of the functions to suit the needs of the model. The F functions describe the follower’s interaction with other followers, typical it works to keep other agents outside of the agent’s personal zone. The O
jfunctions describe human instincts related to objects such as avoiding walking into walls and instead predicting a path to avoid them. The v
i,de
i,dterm describes the current desired velocity to be traveling in and is typical goal driven. I our case it mostly involves following the leader.
The αv
iterm represents a damping term for the growth of the velocity of the agent. It can also be thought of as describing the increased exhaustion a higher movement speed generates.
2.1.1.1 Sensing ability of follower agent
Humans can sense and detect the environment using their sight, hearing and other sensing abilities. Their actions are heavily based upon their detecting results and thus give rise to the importance of sensing-acting interaction in the model. Due to efficiency and simplicity requirements, the main focus of the model lays on the visual sense realization.
The figure below illustrates the idea of visual sensing.
Chapter 2. The mathematical model 6
Figure 2.1: An illustration of an agents sight range.
As shown in the figure. Define the sight range of agent i to have the circle form with radian S
i. Any target point can be recognized by agent i if two necessary conditions are fulfilled. For the first target point should position within the sight range of i. For the second target point should not be blocked by any obstacles of any kind i.e. no other point-objects on the line connecting agent i and target. These conditions can be expressed mathematically as below.
Condition1 :|V
target| ≤ S
iCondition2 :if no V
obssuch that 1 − V
target|V
target| · V
obs|V
obs| ≤ 0.001
V
targetis the vector from agent i to the target point. V
obsis the vector from agent i to any other point objects withing the sight range of agent i. By using these conditions a weight function w
visualcan by defined:
w
visual=
1 if Condition 1 and 2 are fulfiled 0 else
(2.7)
Thus the social force from any target point acting on agent i is only active according to the value of w
visuali.e.F
target= F
targetw
visual2.1.1.2 The desired direction
In the situation of a fire disaster, people tend to follow certain target as their guidelines
in order to get out of the danger. In the system of concern, it is assumed to have two
Chapter 2. The mathematical model 7
types of such targets. The first is the exit to get out of the building and the second is the fireman i.e. the leader agent that can be trusted to lead them to safety. The desired velocity of follower agent in the social force model definition 3 should thus depend on these two target objects. The definition of desired velocity of agent i is as follow
v
d= X
targetj
w
visualw
targetv
de
d,jwhere e
d,j= N
j|N
j| (2.8)
j is any possible target i.e. exit or leader. The desired velocity is the sum of contributions from all target objectives for agent i i.e. all exits and leaders introduced in the system.
w
visualis the visual weight function defined in equation (2.7). w
targetis a constant weight associated with each target as the fact that certain targets are more attractive than others. N
jis the vector pointing from agent i to its target j, the definition of the desired velocity will result in the agent to be forced toward the target and thus mainly cause the tracking-after-leader phenomenon.
2.1.1.3 The memory ability of agents
Humans have the ability to store information in their memory. This ability can be used to guide their movement. Thus such an influence causing by retention is essential in the model, especially when agent lost its sight of a certain target. As a natural fact the memory should lead the agent to position where the connection was lost. A simple way to realize this phenomenon is by introducing a third target objective for the follower agent, namely the memory position P
memodefined as follows
P
memo=
X
iif agent i have not located any target since t = 0
X
iif agent i have located a target and maintained the connection P
targetelse
where P
targetis the position where agent i located his target for the last time.
By introducing this definition the P
memofor agent i will be updated throughout the time depending on the status of the current situation. Using P
memoand the definition of the desired velocity in equation 2.8 The memory attractive force can be described as the following
F
memo= w
visualw
momev
de
memo(2.9)
with e
memo= P
memo− x
i|P
memo− x
i|
The F
memoguides the agent in case the connection to the target is lost.
Chapter 2. The mathematical model 8
2.1.1.4 The follower-follower functions
The ordinary people in a fire disaster are represented as followers in the model. The motion of each follower agent is influenced by other followers. As a psychological result he/she tries to keep a certain minimum distance from other followers. This repulsive effect is realized in the model by the following equation
N
X
j=1
A
ie
(rij−Dij)/BiN
ji(2.10)
A
iand B
iare constants representing the interacting strength and range, receptively. R
ijis the sum of the radii of agent i and j, D
ijis the distance between the center of mass of agent i and j and N
jiis the normalized unit vector pointing from agent j to agent i.
In situation when agents get in physical contact with each other, that is when R
ij≥ D
ij, additional physical force will be acted upon agents, this physical force is modeled by the following equation
N
X
j=1
(G(r
ij− D
ij)(K
1N
ji+ K
2∆V
ijT
ij)) (2.11) K
1and K
2are two large repulsive force constants representing the body force and slid- ing friction force between agents, respectively. G is a Heaviside function, where G(x) is zero when agents do not touch each other, and equals to argument x otherwise. T
ijis the unit vector with the direction tangential to e
i,d(t) and ∆V
ijis the tangential velocity difference. Combining equations 2.10 and 2.11 gives us the F
i, f ol equations as
F
i,f ol=
N
X
j=1
A
ie
(rij−Dij)/BiN
ji+
N
X
j=1
(G(r
ij− D
ij)(K
1N
ji+ K
2∆V
ijT
ij)) (2.12)
The equation (2.12) gathered above is the general result from Social force model [1]. Also this equation works fine within some extensions; a few modifications were made for more humanlike behaviors. One of the situations where (2.12) fails to produce desired results is when two agents are facing each other in the opposite direction with high accelerations i.e. high social force. A brutal collision will occur if no damping force is introduced. To solve this issue the following terms are introduced in the follower-follower model.
N
X
i=1
−w
dampA
dampv
i· N
ije
Dij−rijN
ij(2.13)
and
N
X
i=1
w
dampA
dampsidee
(rij−Dij)/BdampsideT
ij(2.14)
Chapter 2. The mathematical model 9
where
w
damp=
1 if n
i· n
j+ 1 ≤ 0.05 0 else
(2.13) realize the fact that the human tends to slow down when someone is heading against him. A
dampis the damping constant representing the strength of the damping force. This force is in the direction of N
ij. (2.14) realize the fact that human tends to turns to the side to avoid collision. A
dampsideis the damping constant representing the desire to head to the side. w
dampis the damping weight. n
iis the direction of movement for agent i and n
jis the direction of movement for agent j. The Definition of w
dampallows the damping forces to be active only in the situation when someone is recognized by the agent i to direct against him.
By adding these additional force terms to equation (2.12), we get the following expression.
F
i,f ol=
N
X
j=1
A
ie
(rij−Dij)/BiN
ji+
N
X
j=1
(G(r
ij− D
ij)(K
1N
ji+ K
2∆V
ijT
ij)) +
. +
N
X
i=1
−w
dampA
dampv
i· N
ije
Dij−rijN
ij+
N
X
i=1
w
dampA
dampsidee
(rij−Dij)/BdampsideT
ij(2.15)
2.1.1.5 The follower-obstacle functions
Beside the influence from other agents, the motion of agent also depends on the appear- ance of obstacles in the environment. To avoid obstacles, social forces much similar to those described by equation 2.10 and 2.11 is apparent. The model is as follow
O
i,obs=
W
X
j=1
A
ie
(ri−Dij)/BiN
ji+
W
X
j=1
(G(r
i− D
ij)(K
1N
ji+ K
2∆V
ijT
ij)) +
. +
W
X
i=1
−w
dampA
dampv
i· N
ije
Dij−riN
ij+
N
X
i=1
w
dampA
dampsidee
(ri−Dij)/BdampsideT
ij(2.16)
The main difference to the follower-follower model is that the obstacles have fixed posi-
tions. The N
ijbecomes in this case the unit normal vector from the wall j and T
ijis
the unit vector tangential to N
ij. There are two candidates to the direction of T
ij. To
model the human behavior realistically the direction of T
ijis chose to be the one with
a smaller deviation angel with respect to v
iChapter 2. The mathematical model 10 2.1.2 Danger and obstacles
The obstacles of the environment is modelled as points, large objects such as walls or tables are modelled by collections of points tightly packed around the objects border, the way the follower-obstacle function has been designed makes it so that the followers will not be able to pass through them. Certain obstacles are also associated with danger, the typical such obstacle would represent a fire. Together all of these danger associated obstacles generate a ’danger function’ D(x) that describes how dangerous each position is to be staying in.
Definition 4. The danger function at the position x is defined as
D(x) =
0 if at exit
P
F
(2 · exp(3 − |x − x
F|)) if else
where the sum is take over all points of fire. This is a oversimplified model of the danger in a fire situation. It may lack realistic correspondence but will still give some feel about how the danger may be modelled.
2.2 Modeling the leader
Based upon the idea of saving people by controlling the fireman, the path of the leader
will be constructed using an optimal control approach[15] aiming to minimize the danger
of all agents as well as the distance to the exit. Since the leader also represent a human
it will also be modeled using a second order system and parts of the social force model
can be applied even here to avoid obstacles. This leads to the following definition:
Chapter 2. The mathematical model 11
Definition 5. The path of the leader denoted x
tis given by an optimal solution to the problem
min
N
X
i=0
w
iZ
T0
(D(x
i(t)) + β|x
i(t) − x
E|) dt + 30w
iN
X
i=0
D(x
i(T ))
s.t. ∂x
0∂t = v
0∂v
0∂t = U(t) +
W
X
j=1
O
obs(x
0, w
j) − αv
0|U(t)| ≤ U
maxx
0(0) = x
Ev
0(0) = 0
∂x
i∂t = v
i∂v
i∂t = X
j6=i
F
i,f ol(x
i, x
j) +
W
X
j=1
O
i,obs(x
i, w
j) + e
i(x
0) − αv
ix
i(0) = x
i,startv
i(0) = 0
where x
0is the position of the leader, x
Eis the location of the exit, T is the end time of the problem and w
iis the importance weight for agent i. The importance weight represents that saving a child can be considered more desirable than saving a 40 year old criminal.
One could think that the objective function in this definition only depends on the move- ment of the leader in the first term since it is the only term containing any direct refer- ences to the leader, this is not the case since the movement of the followers is affected by the leader through the desired direction term. This definition will thus result in the leader trying to minimize the danger of the other agents as well.
2.2.1 Approximate leader
While the above definition 5 is quite straightforward to define, finding an actual optimal solution is far from simple. Thus even semi-optimal and numerical solutions of the stated problem are interesting to look at. One way of finding approximate solutions to the problem is by discretizing the time and the derivatives using the finite difference method
∂x
∂t (t) ≈ x(t + τ ) − x(t)
τ (2.17)
Chapter 2. The mathematical model 12
where τ is a small time step. The discretization acting upon the object function of definition 5 will produce the following discretized version of objective function
N
X
i=0 T /τ
X
n=0
(w
iD(x
i(nτ )) + β|x
i(nτ ) − x
E|) + 30w
iN
X
i=0
D(x
i(T )) (2.18)
The differential equations for both the leader and the followers will also be changed when doing this approximation. Generally a ODE of the form
∂G
∂T = F (t) (2.19)
will be converted into T
τ equations of the form
G(t + τ ) = G(t) + τ F (t) (2.20)
that will transform the problem. All the equations can be calculated explicitly thanks to the initial conditions.
The complete discretizised problem becomes:
min
N
X
i=0
w
i T /τX
k=0
(D(x
i(kτ )) + β|x
i(kτ ) − x
E|) + 30w
iN
X
i=0
D(x
i(T )) s.t. x
0((k + 1)τ ) = x
0(kτ ) + τ v
0(kτ )
v
0((k + 1)τ ) = v
0(kτ ) + τ
U(kτ ) +
W
X
j=1
O
obs(x
0(kτ ), w
j(kτ ) − αv
0)
|U(t)| ≤ U
maxx
0(0) = x
Ev
0(0) = 0
x
i((k + 1)τ ) = x
i(kτ ) + τ v
i(kτ ) k = 1, 2, 3 · · · T τ v
0((k + 1)τ ) = v
0(kτ ) + τ
X
j6=i
F
i,f ol(x
i, x
j) +
W
X
j=1
O
i,obs(x
i, w
j) + v
i,de
i,d(x
0) − αv
i
x
i(0) = x
i,startv
i(0) = 0 k = 1, 2, 3 · · · T
τ
where each k gives rise to four new equations.
Chapter 3
The Simulation
3.1 The followers - SIMULINK
For preforming the actual simulations of the followers behaviour defined in 2 the propri- etary simulation software Simulink is used.[16] Simulink implements models by allowing the user to construct the corresponding state-space model in a graphical interface. The model is then solved by one of the built in solvers. The solver and special parameters of the solver such as step length or error tolerance can be specified by the user. The main motivation for using Simulink is its close integration with MATLAB that gives access to a powerful optimization toolbox.[17]
The solver corresponding to the euler discretization done in equation 2.20 in simulink is called ODE1 and can be found under the fixed step solvers. For the simulink model a quite small step size needs to be chosen, as a largest the step size can be of the size 0.02 seconds. The problem that arises from too large step sizes are not related to any instabilities of the converges of the discretazied model but instead arise from the fact that equation 2.16 is non-linear and has extremely large values close to the obstacle. A large step size will thus result in situations where the agent gets unreasonably close to the obstacle and will thus experience an extremely large force that otherwise would not have occurred. Empirical investigations has shown that this problem start to arise for values larger than 0.02 seconds. To avoid this issue a step size of 0.01 seconds is used.
It is possible that certain correcting forces in the social force model or differently tuned agent parameters could avoid this problem, the later is however hard to motivate from a model validity perspective.
The implementation builds on scaleability of user agents through mainly matrix repre- sentations of all agents locations as well as a couple of user defined functions. Each
13
Chapter 3. Introduction 14
property such as size, speed or reaction to others can thus be individually tuned through matrix operations and MATLABs element-wise operations. The user defined functions primarily calculates the sums in definition 5 and 3 and is the cause of majority of the simulations running time.
3.1.1 The room
The standard room in which all simulations for this rapport is preformed is loosely based on the computer labs in the E building of the main campus of the Royal institute of Technology. The reason for using this area as a model for the tests is based on the fact that spontaneous fires are relative probable compared to ordinary rooms due to the high concentration of technology and the room layout allows for several different path choices from each point. Three fires are placed inside the room at semi-choke points in order to get a non trivial evacuation. The room with the fires placed can be seen in figure 3.1.
0 2 4 6 8 10 12 14 16 18
0 5 10 15 20 25
Figure 3.1: The simulation room, Cyan represents obstacles and red represents fires.
The objective function in definition 5 to be minimized is overlaid with the standard room
in figure 3.2 for the purpose of illustrating how the danger in the room is modelled.
Chapter 3. Introduction 15
Figure 3.2: The danger function in the room. The applied colormap is JET with red as most dangerous and blue as least dangerous.
3.2 The leader - Optimization
To find an numerical semi-optimal path for the leader to take MATLAB and its powerful optimization toolbox that contains a great deal of different optimization algorithms is used. The advantage in using MATLAB is mainly the immense time save in not imple- menting our own version of the optimizations algorithms, MATLAB also has support for parallel execution in its routines which also is non trivial to implement efficiently.
The problem to be minimize is a multi variable, non linear constrained optimization problem, this demands the use of the matlab routine fmincon [18], since it is the only one that solves such problems. fmincon does however allow for different choices in optimization algorithm to solve such problems. The reasoning of which algorithm to use is described in the next section.
We choose to simplify our problem in the numerical solution to not being a full optimiza-
tion of U (t) for every time step in the simulation. The choice is taken mainly due to the
time reasons. If one was to use a full optimization for every time step of the simulation
it would for a 60 second simulation with a time step of 0.01 seconds arrive at 6001 points
that should be optimized. Since the problem is a two dimensional problem this would
Chapter 3. Introduction 16
result in a single hessian evaluation requiring at least 12002 simulation evaluations. To avoid this time sink the optimization is limited to only 30 points and thus reduce the required amount of function calls by a factor of 200. To find the values of U(t) for the time steps in between these 30 points a linear spline interpolation is performed. Doing this can also be motivated through the fact that controlling a fireman’s path at a 0.01 second precision is quite unrealistic.
3.2.1 Optimization algorithms
The available algorithms of fmincon are the Trust region reflective, Active set, SQP and interior point algorithm.[19] The Trust region reflective algorithm is not applicable to our problem since it requires an analytically defined Hessian of the objective function.
That would require an analytic solution to the behavior of the system given a specific function U (t) which is not available due to the complexity of the system involving things such as heaviside functions and differential equations: Using a simpler, smoother model could eliminate this problem and make this algorithm applicable.
For the remaining algorithms to be considered the implementation of interior point algo- rithm is primarily a large scale algorithm[18] and thus require the use of sparse matrices.
The problem is not a sparse problem so disregarding the use of the interior point al- gorithm is a good decision. This leaves the active set and SQP implementations which are rather similar that both try and estimate the original problem with a quadratic pro- gramming optimization problem. This simpler problem is then numerically solved by estimating the hessian of the problem with finite differences and using quadratic pro- gramming theory. The active set algorithm is chosen due to its ability of taking large steps[20] compared with SQP. An additional reason is SQP has implementations that can delay the already slow solution process.[18]
3.2.2 Simplified model
The complete model derived in chapter 2 may result in quite time consuming opti- mization, to reduce the running time a simplified model is implemented with only the repulsive forces towards agents and obstacles as well as the desired direction introduced.
The optimization algorithm using this simplified model was processed with five paths in
order to gain new and improved paths. The generated paths are then tested in the com-
plete algorithm and the results are compared with the full optimization. Using a weak
constraint and algorithms for unconstrained optimization was also tested, no significant
speed up was detectable for such a method.
Chapter 4
Results & Discussion
4.1 Results of the follower simulations - are they realistic?
The results of the simulations of the follower agents are satisfactory, the agents behave human like in most situations but there are still special cases that makes the incomplete- ness of the model apparent. One such situations are following walls with corners, more often then not the agents can get stuck after following a wall to corner due to the fact that the extremely small amount of path finding terms in the model. The model is also quite unrealistic in the sense that agents do not try to save themselves. This is however something that could be implemented through the use of the desired direction and an exploration term for the agents.
The overall conclusion is that the agents behave realistically in the large part of situa- tions in which they encounter, they do however experience a somewhat large degree of bounciness due to sharp interactions with the walls. This phenomena should be avoidable through better interaction parameter tuning.
4.2 The optimization and the path of the leader
The optimization procedure unfortunately only generate local minimums that generally does not differ all too much from the initial guess. The results will thus be firstly more orientated towards in which order to enter rooms and secondly the actual path in the rooms. The same conditions for the parameters of the model and the locations of the agents were used for each run, most parameter values corespond roughly with those in Helbings works[1]. The five initial paths that were studied can be seen in figure 4.1. The four first paths are paths to demonstrate the algorithm and the fifth path is a reasonable
17
Chapter 4. Results & Discussion 18
path for the test of a more realistic situation. All the paths have a relatively close values of the objective function to each other, varying between 5500 and 6200.
0 2 4 6 8 10 12 14 16 18
0 5 10 15 20 25
x−Distance [m]
y−Distance [m]
Path 1
(a) Path 1
0 2 4 6 8 10 12 14 16 18
0 5 10 15 20 25
x−Distance [m]
y−Distance [m]
Path 2
(b) Path 2
0 2 4 6 8 10 12 14 16 18
0 5 10 15 20 25
x−Distance [m]
y−Distance [m]
Path 3
(c) Path 3
0 2 4 6 8 10 12 14 16 18
0 5 10 15 20 25
x−Distance [m]
y−Distance [m]
Path 4
(d) Path 4
0 2 4 6 8 10 12 14 16 18
0 5 10 15 20 25 30
x−distance [m]
y−distance [m]
Path 5
(e) Path 5
Figure 4.1: The five different inital paths. The red dot represents the initial position.
4.2.1 The complete model
The objective function at each step in the simulation for all the initial paths as well as
the result after the optimization is plotted in figure 4.2. One can note that the general
idea for all the paths is to temporarily increase the danger in order to later reach a lower
level resulting in a total lower danger. In figure 4.2 the most of the improvement are
Chapter 4. Results & Discussion 19
observed to be done at the second half of the optimization. This is due to the fact that optimization finds local minimums and changing the path early on would most likely lead to a collision with a wall for the leader later on. This could prevent the leader from entering a room which in turn would lead to an agent being left in a dangerous situation. So an improvement early on would lead to a more dangerous situation later on. One could expect this to be corrected by changing the path later on as well, however such a change would require global information of the problem which the solver does not have. To summarize the optimization algorithm does not used the principle of increasing danger temporarily to later on gain a better result in the save way that the leader does.
The comparison of the total danger for the different paths before and after optimization are gathered in the table below.
Path Danger before Danger after Difference # of extra agents saved
Path 1 5938 3729 2210 2
Path 2 6103 4446 1657 2
Path 3 5910 3544 2366 3
Path 4 5505 4603 901 1
Path 5 6205 4879 1326 1
Table 4.1: Comparison of the objective function for the complete model.
As shown in the table the optimization does for all the paths, it reduce the danger for
the path by atleast 15%. The worst result for the danger is the realistic path, it also
has the second worst improvement. One possible explanation for this is that the realistic
path is quite fast for the leader, this means that the leader risks leaving agents behind
by moving too fast, this is also what happens in path 5 the realistic path. The local
minimum convergences then does not allow for the path to be slowed down in sufficient
way to attain better results.
Chapter 4. Results & Discussion 20
0 1000 2000 3000 4000 5000 6000 7000
0 20 40 60 80 100 120 140 160
Timstep, H = 0.01
Danger
Path 1, Complete optimization
(a) Path 1
0 1000 2000 3000 4000 5000 6000 7000
0 20 40 60 80 100 120 140 160 180
Timstep, H = 0.01
Danger
Path 2, Complete optimization
(b) Path 2
0 1000 2000 3000 4000 5000 6000 7000
0 20 40 60 80 100 120 140
Timstep, H = 0.01
Danger
Path 3, Complete optimization
(c) Path 3
0 1000 2000 3000 4000 5000 6000 7000
0 20 40 60 80 100 120
Timstep, H = 0.01
Danger
Path 4, Complete optimization
(d) Path 4
0 1000 2000 3000 4000 5000 6000 7000
0 20 40 60 80 100 120 140
Timstep, H = 0.01
Danger
Path 5, Complete optimization
(e) Path 5
Figure 4.2: The danger function for the different paths before and after complete optimization. The red line represents the optimized result.
4.2.2 Using the simplified model
For the simplified models the optimization result can be viewed in figure 4.3 and in table
4.2.
Chapter 4. Results & Discussion 21
Path Danger before Danger after Difference # of extra agents saved
Path 1 5938 5007 932 1
Path 2 6103 4813 1290 2
Path 3 5910 4141 1769 3
Path 4 5505 4581 924 2
Path 5 6204 6187 18 0
Table 4.2: Comparison of the objective function for the simplified model.
0 1000 2000 3000 4000 5000 6000 7000
0 20 40 60 80 100 120 140 160
Timstep, H = 0.01
Danger
Path 1, Simplified optimization
(a) Path 1
0 1000 2000 3000 4000 5000 6000 7000
0 20 40 60 80 100 120 140 160 180
Timstep, H = 0.01
Danger
Path 2, Simplified optimization
(b) Path 2
0 1000 2000 3000 4000 5000 6000 7000
0 50 100 150
Timstep, H = 0.01
Danger
Path 3, Simplified optimization
(c) Path 3
0 1000 2000 3000 4000 5000 6000 7000
0 20 40 60 80 100 120
Timstep, H = 0.01
Danger
Path 4, Simplified optimization
(d) Path 4
0 1000 2000 3000 4000 5000 6000 7000
20 40 60 80 100 120 140
Timstep, H = 0.01
Danger
Path 5, Simplified optimization
(e) Path 5
Figure 4.3: The danger function for the different paths. The red line represents the
optimized result
Chapter 4. Results & Discussion 22
From the results above an obvious observation is that even using a simplified model will still generate a significant improvement of the leader’s path. The results of this optimization is also concentrated to the later part of the optimization.
Even though the changes in the input U (t) is quite small between the initial path and the optimized path, the changes in the shape of the path is not necessarily small. As an example the max norm of the difference between the second initial path and the optimized result is 3.26 · 10
−5. The result of this small difference is illustrated in figure 4.4 and as one can see the difference is quite significant and certainly not a change one would expect from a change as small as 10
−5.
0 2 4 6 8 10 12 14 16 18
−5 0 5 10 15 20 25 30
Path 2, Comparision