1. Introduction
Cities and their infrastructure face a high possibility of suffering disasters due to a combination of natural and human-made factors [
1,
2]. Rapid urbanization often leads to overcrowded areas with inadequate planning and resilience measures, making cities vulnerable to events such as earthquakes, floods, hurricanes, and fires. Additionally, climate change exacerbates the frequency and intensity of natural disasters [
3], while human activities like industrial accidents, terrorism, and infrastructure failures further increase risk. The concentration of population and assets in urban areas amplifies the potential impact of these disasters [
4], necessitating robust planning and preparedness to mitigate their effects and ensure the safety and sustainability of urban environments.
Evacuation models [
5] are crucial for evaluating risk and ensuring safety in the development of cities. These models enable city planners to simulate various emergency scenarios, such as natural disasters or fires, and understand how people will likely behave and move in these situations. By incorporating advanced paradigms, evacuation models provide interesting data and insights that help optimize resource allocation [
6], enhance emergency preparedness, and improve infrastructure design. The use of these models not only mitigates risks but also ensures that smart cities are resilient, safe, and capable of protecting their inhabitants effectively during emergencies.
Several evacuation models have emerged to address the characterization of the evacuation process, offering a range of strategies and methodologies. Among these, continuous flow models, such as the Greenshields model [
7] and various pedestrian continuous flow models [
8,
9,
10,
11], apply fluid mechanics principles to represent the movement of people in specific environments. These models are widely used to analyze the flow of people in different types of buildings and public spaces. Additionally, agent-based models like the Social Force Model (SFM) [
12] and Cellular Automata Models (CAMs) [
13,
14,
15] focus on the individual and collective interactions of evacuating agents, considering social forces and behavioral rules. SFM treats individuals as agents interacting with each other and the environment, factoring in social forces like attraction between individuals and repulsion from obstacles. CAMs, on the other hand, discretize space into cells and simulate the movement of individuals from one cell to another according to specific rules, making them effective for studying crowd dynamics in particular environments. Dynamic network models [
16,
17] use network theory to map connections and routes in complex environments, while popular route optimization algorithms [
18,
19], such as Dijkstra’s algorithm [
18], focus on finding efficient paths in predefined networks. Although these algorithms are not specifically designed as evacuation models, they can be instrumental in planning evacuations by identifying the shortest routes between points in a network. Lastly, the Pathfinder evacuation simulator [
20] models crowd behavior in buildings and other environments by considering exit capacity, movement speed, and individual decisions, allowing for the visualization of people’s flow and the evaluation of evacuation routes’ effectiveness.
Table 1 shows a summary of the evacuation models proposed in the literature and their main characteristics. Despite the interesting results of all these approaches, several drawbacks exist in traditional evacuation models [
21]. Firstly, these methods rely on complex mathematical models, making them difficult to understand and modify for simulating different conditions or characterizing other scenarios [
22]. Additionally, these models are often static [
23,
24,
25], meaning they do not account for changing environments during an evacuation. This is unrealistic because, in real-life evacuation situations caused by disasters, fires, or terrorism, conditions frequently change, such as doors closing or roads being blocked by falling objects [
26]. Another limitation is that these models primarily focus on individuals, characterizing them as agents that consistently act according to mathematical formulations. These approaches do not account for the emotional states of individuals, such as hysteria and disorientation caused by fear, which significantly influence evacuation behavior, timing, and outcomes [
27]. Hence, the inability to incorporate these dynamic and emotional factors limits the realism and effectiveness of traditional evacuation models.
Agent-based models (ABMs) [
28] are computational frameworks used to simulate the actions and interactions of autonomous agents, which can be individuals, groups, or entities, within a defined environment [
29]. Each agent operates based on a set of rules and behaviors [
30], allowing them to make decisions, adapt to changes, and interact with other agents and the environment. ABMs are particularly useful for studying complex systems and emergent phenomena, where the collective behavior of agents leads to patterns and outcomes that are not easily predictable from individual actions alone. These models are widely applied in several fields [
31] such as social sciences, economics, epidemiology, and urban planning, offering insights into how decentralized interactions can lead to the emergence of complex behaviors and system-level dynamics. By capturing the heterogeneity and adaptability of agents, ABMs provide a powerful tool for analyzing scenarios ranging from market dynamics to evacuation processes, making them essential for understanding and managing complex, adaptive systems.
The key difference between ABMs and traditional models based on equations and mathematical formulations lies in their approach to representing and simulating systems [
32]. Equation-based models use mathematical equations to describe the average behavior of a system as a whole, often relying on differential equations to capture the relationships between different variables [
33]. These models are typically deterministic and assume homogeneous behavior across the system, making them suitable for scenarios where the overall dynamics can be accurately captured by aggregate equations. In contrast, ABMs simulate the actions and interactions of individual agents, each with distinct behaviors and characteristics, within a defined environment [
34]. This agent-centric approach allows ABMs to capture the heterogeneity and adaptability of individuals, reflecting the diversity of behaviors and decision-making processes in a population. ABMs are particularly advantageous for characterizing heterogeneity because they can model complex interactions and emergent phenomena that arise from individual differences, providing a more nuanced and realistic representation of systems where individual variations significantly impact outcomes. Considering the main characteristics of ABMs, it can be said that they are particularly well-suited for building evacuation models due to their ability to simulate the diverse behaviors and interactions of individuals in dynamic environments. Unlike traditional equation-based models that assume uniform behavior across a population, ABMs allow for the representation of heterogeneous agents [
35], each with unique characteristics and decision-making processes. This makes it possible to capture the complexity of human behavior during evacuations, such as panic, cooperation, and the influence of social relationships. Additionally, ABMs can dynamically adapt to changing conditions, such as blocked exits or evolving hazards, providing a more realistic simulation of emergency scenarios. By incorporating individual variability and environmental changes, ABMs offer a robust framework for evaluating evacuation strategies, optimizing resource allocation, and improving overall safety and efficiency in emergency planning. This adaptability and realism make ABMs superior for developing comprehensive and effective evacuation models.
This study presents an evacuation model based on agents. The model has a simple design, incorporating only five rules to imitate the dynamics of evacuation. The rules capture complex aspects such as movement and stagnation and common behaviors of individuals in emergency situations, including accidents, hysteria, and disorientation. This approach differs from many conventional evacuation models by incorporating rules that simulate typical behaviors observed in high-stress evacuation scenarios, such as accidents, panic, and confusion. By integrating these behavioral factors, the model provides a more accurate representation of how people respond during evacuations, resulting in more true-to-life and practical outcomes. To assess the performance of the proposed model, it was tested in three experiments: one conducted in a real-world setting at the Hospital “Civil Viejo Fray Antonio Alcal-de” in Guadalajara, Mexico, and two hypothetical scenarios, including a labyrinth and a train station. The outcomes of these experiments suggest that this model offers valuable insights into the evacuation process and enables more precise evaluations of its behavior during emergencies.
The structure of the remainder of this paper is as follows:
Section 2 considers the foundational principles of agent-based models.
Section 3 then presents the proposed evacuation agent-based model.
Section 4 subsequently conducts a series of experiments to evaluate the effectiveness of the proposed evacuation model. Lastly,
Section 5 draws conclusions from the aforementioned analysis.
2. Agent-Based Models
An ABM is a computational simulation framework that represents and analyzes the actions and interactions of autonomous agents, which can be individuals, groups, or entities, within a specific environment [
36]. Each agent operates based on a set of rules and behaviors, allowing them to make decisions, adapt to changes, and interact with other agents and their surroundings. This agent-centric approach enables ABMs to capture the heterogeneity and complexity of individual behaviors and their collective impact on the system. In contrast, traditional mathematical models use equations to describe the average behavior of a system as a whole, often relying on differential equations to represent the relationships between aggregated variables. These models assume homogeneity and predict outcomes based on average trends, which can overlook individual variations and localized interactions. The key difference is that ABMs focus on the micro-level interactions and individual variability [
37], leading to emergent phenomena that can be more realistic and nuanced, making them particularly effective for studying complex, adaptive systems like social dynamics, market behavior, and evacuation processes.
Rules in ABMs [
38] are crucial as they define the behavior and interactions of individual agents within the simulation. These rules determine how agents make decisions, respond to their environment, and interact with each other, ultimately driving the dynamics of the entire system. The most common types of rules in ABMs include movement rules, which dictate how agents navigate their space; interaction rules, which govern how agents influence and are influenced by other agents; and decision-making rules, which outline the criteria for agents’ choices based on internal states or external stimuli.
The process of an agent-based model involves the interaction of a population
of
different agents which are defined as follows:
An ABM considers several important steps. Initially, the agents () are initialized. In this process, to each agent, random attributes that determine their position, state, or condition are assigned. With these random attributes, the population of agents will be heterogeneous. During the processing, agents are then randomly selected or follow a predefined order. The selected agent, (where ), follows a set of established rules, modifying its state, position, or relations with other agents. These rules commonly consider the current agent, their neighboring counterparts, and the environment. Finally, a stop criterion is defined to conclude the process once a determined state or condition is reached. This structured approach allows for the simulation of complex, dynamic systems, providing insights into emergent behaviors and interactions within heterogeneous populations.
Rules in ABMs are essential as they dictate the behavior and interactions of individual agents, driving the dynamics and outcomes of the simulation [
39]. These rules enable the model to capture the complexity and diversity of behaviors within a population, reflecting how agents respond to various stimuli and interact with each other and their environment. The importance of rules lies in their ability to create realistic and adaptable simulations, which can be used to study a wide range of scenarios and phenomena. IF–THEN rules are a common type of rule used in ABMs, providing a straightforward way to encode agent behaviors. These rules allow for conditional responses based on the current state or environment of the agent, facilitating the modeling of complex decision-making processes and adaptive behaviors. By using IF–THEN rules, ABMs can simulate how agents react to different situations, leading to emergent patterns and insights into the system being studied.
ABMs and traditional mathematical models differ fundamentally in their approach to representing and simulating systems [
30]. ABMs focus on the micro-level interactions of individual agents, each with unique characteristics and behaviors, within a defined environment. This agent-centric approach allows for the modeling of heterogeneity and complex interactions, leading to emergent phenomena that arise from the bottom-up. In contrast, traditional mathematical models, often using differential equations, represent systems from a top-down perspective by describing the aggregate behavior of the system as a whole. These models typically assume homogeneity and average out individual differences, providing a deterministic and continuous representation of the system dynamics. While traditional models are powerful for capturing broad trends and steady-state behaviors, ABMs excel in scenarios where individual variability, local interactions, and adaptive behaviors play a crucial role, offering a more granular and dynamic understanding of complex systems.
The concept of emergence in the context of ABMs refers to the phenomenon where complex patterns, behaviors, and properties arise from the simple interactions of individual agents within the system [
40]. These emergent properties are not explicitly programmed into the model but instead result from the collective dynamics and local interactions of agents following basic rules. Emergence illustrates how decentralized and individual-level interactions can lead to organized and often unpredictable macro-level phenomena, providing insights into the underlying mechanisms driving complex systems.
3. The Proposed Evacuation Agent-Based Model
This section discusses the proposed agent-based model designed to emulate evacuation processes in complex scenarios. This model captures the diversity of individual behaviors and complex interactions, particularly under difficult emotional conditions such as hysteria or disorientation that individuals might experience during the evacuation process. For clarity, the discussion is divided into three main parts: (A) environment setup, (B) agents and rules, and (C) computational procedure. Part A focuses on creating the environment using a grid as location map to position individuals, exits, and obstacles. It also discusses the Chamfer distance algorithm, which calculates efficient escape paths while integrating dynamic changes such as new obstacles or blocked exits to add realism and complexity. Part B defines the behavioral rules assigned to the agents, explaining how these rules determine responses under various conditions and allow the visualization of emergent patterns in the evacuation process. Part C presents the entire computational procedure, discussing the pseudo-code and other elements that provide a clear guide for implementation.
3.1. Environment Setup
In agent-based models, the use of an environment is critical to provide an essential spatial context for simulations. In our approach, we use as environment a bidimensional discrete grid of cells to represent the environment of agents. This offers several advantages. Firstly, it provides a clear and intuitive framework for modeling spatial relationships and movements, making it easy to visualize and analyze the interactions between agents and their surroundings. Each cell in the grid can represent different environmental features, such as open spaces, individuals, obstacles, and exits, allowing for a detailed and flexible representation of the scenario. This approach also simplifies the implementation of rules governing agent behavior, as movement and interaction can be easily mapped onto the discrete grid. Additionally, a bidimensional grid facilitates the use of computational algorithms, such as pathfinding and distance calculations, enhancing the model’s efficiency and realism. Overall, the discrete grid approach balances simplicity and detail, making it a powerful tool for simulating complex systems and emergent phenomena in agent-based models.
In the initialization of the environment, all the elements of the grid are initialized to zero (. Then, the elements corresponding to the outputs in the evacuation model are set to one (). This information is used to create a distance map . This map visualizes in each grid cell the shortest distance to the element with value 1 (the exit in the evacuation model). In order to produce the distance map. The Chamfer method is used. The Chamfer algorithm is a technique used to calculate approximate distances within a discrete grid, typically employed in the context of pathfinding and shape analysis. It operates by iteratively propagating distance values through the grid, creating a distance map that represents the shortest path from each cell to a set of target cells, such as obstacles or exit points. The algorithm typically uses a forward and backward pass to update the distance values. In the forward pass, each cell’s distance is updated based on its neighboring cells to the top and left (using a mask ), while in the backward pass, updates are based on the neighboring cells to the bottom and right (using a mask ). This two-pass approach ensures that distance values are accurately propagated throughout the grid. The distances are calculated using a set of predefined weights that approximate the Euclidean distance, allowing the algorithm to efficiently handle various grid configurations. As a result of the process, the distance map is produced. The Chamfer algorithm’s ability to quickly generate distance maps makes it an ideal tool for real-time applications in agent-based models, enabling dynamic updates and realistic simulations of agent movements and interactions within complex environments.
Figure 1 illustrates the evolution of the process performed by the Chamfer algorithm to generate the distance map.
Figure 1a represents the original grid
, where all its values are zero except for two elements representing the outputs (
). Under these conditions, the Chamfer technique calculates the distance from each cell (with a value of zero) to the grid element(s) with a value of one. Considering
Figure 1a as an input, the Chamfer transform is applied using a dual process with the masks shown in
Figure 1b. The result of this processing is the distance map,
, displayed in
Figure 1c. In this final map,
, all cells with an initial value of zero in the grid
have been assigned a value corresponding to the distance from that cell to the nearest output. For example, in
Figure 1c, the element
has a value of 3, indicating its distance to one of the defined outputs. This visualization highlights how the Chamfer algorithm effectively calculates and assigns distance values across the grid, reflecting the proximity of each cell to the nearest target or output point.
Once the distance map
is created, obstacles can be configured. Obstacles represent cells or groups of cells that cannot be occupied, so their distance
value to the doors is set to a very large number. By assigning such a high distance value, these cells are effectively blocked from being used as an evacuation path. The
value must be greater than the product of the grid dimensions
.
Figure 1c illustrates this process, showing how the element at position
is set as an obstacle in the distance map by assigning it a value of 60. This high value ensures that the cell is considered inaccessible, preventing agents from including it in their evacuation routes and thereby accurately reflecting the presence of physical barriers in the modeled environment.
3.2. Agents and Rules
In the proposed model, the agents {} are initialized or located randomly within the valid cells of the grid , specifically in cells that are not occupied by obstacles or other agents. This setup ensures that each agent starts from a feasible location, facilitating realistic movement patterns within the environment. The number of agents represents the number of individuals that it is desired to evacuate in our model. By positioning agents in accessible and unoccupied cells, the model accurately reflects the initial conditions of an evacuation scenario, allowing for the simulation of realistic interactions and movements as agents navigate towards exits while avoiding obstacles and each other.
Agents in the evacuation model are governed by a set of rules that define their interactions, movement, and decision-making processes. These rules are designed to emulate human behavior in evacuation situations, including potential cases of accidents, panic, and disorientation. The model has five rules. These comprise a movement rule, a stagnation rule, and three behavioral rules. The movement rule dictates how agents navigate the environment, choosing paths based on distance map and avoiding obstacles. The stagnation rule addresses situations where agents are unable to move due to congestion or blockages, guiding their responses to such scenarios. The three behavioral rules consider the emotional and psychological aspects of evacuation, such as panic-induced irrational movements or hesitation due to disorientation. Each of these rules will be explained below in detail.
3.2.1. Movement Rule
The movement rule dictates how agents navigate the environment, choosing paths based on the distance map and avoiding obstacles. In our evacuation model, each agent attempts to move towards the nearest exit based on the shortest path provided by the Chamfer distance map
, adjusting their route in response to environmental changes. In this rule, each agent
explores their immediate neighborhood
, defined by the Moore neighborhood (see
Figure 2a), to decide their next move. The Moore neighborhood includes all eight adjacent cells surrounding the agent. Therefore, agents can move vertically, horizontally, or diagonally to an adjacent cell that is not occupied by another agent. The rule specifies that the agent will move to any cell within the
neighborhood that has a smaller or equal distance value than the current agent position. If multiple surrounding cells within the neighborhood have the same minimum distance value, the agent will randomly choose one of these cells. Thus, if agent
is at position
on the grid, it must check which of the eight
cells have a distance value less than distance in position
. The elements to be analyzed and members of the
neighborhood are defined as follows:
Once the cell that satisfies this condition is found, the agent can move to that new cell position. Thus, the motion rule
can be defined as the change of the position of the agent
from
to
such that the distance of the position
is smaller than that of
within the
neighborhood of
. This rule can be schematized as follows:
where
represents the distance of a particular position of the grid.
Figure 2b shows an example of this rule. In the figure, we assume that there is an agent
in the grid at position
. Its neighbors are the elements of the
set
. As shown, the current distance from the agent’s position to the exit is 4, and within the neighborhood is a cell with a distance of 2. This cell, at position
, will be the new position of the agent, demonstrating how the agent moves to a position that brings it closer to the exit, as part of the operation of this rule.
3.2.2. Stagnation Rule
On several occasions, agents tend to concentrate at the exits, leaving at a slow pace, or encounter obstacles that block the movement in one direction. When this happens, the agents try to keep moving, just as humans do in real life, seeking alternate paths that allow them to reach the exit faster. Under the movement rule alone, this adaptive behavior would not be possible. According to the movement rule, an agent can move from its current cell to another cell (where ) only if the new cell has a distance value smaller than the current . If the agent does not find a cell with these conditions, it cannot move and remains in the same cell. When this happens, the agent presents a state of stagnation, . This limitation necessitates additional rules to enable agents to dynamically seek alternative routes and avoid congestion, thereby reflecting more realistic human behavior during evacuation scenarios.
To avoid over clustering, the stagnation rule
is defined. According to this rule, every time an agent cannot move (
) because there is no cell with a smaller distance, its current distance value is artificially increased by one (
). As a result of this rule, there will come a moment when the distance value of the agent’s current cell
will be greater, enabling the agent
to move to another cell
with a smaller distance by applying the movement rule
. This mechanism prevents agents from becoming indefinitely stuck and promotes continuous movement, allowing them to eventually find alternative paths and reducing the likelihood of congestion at exits. This adjustment ensures a more fluid and realistic simulation of evacuation dynamics. The stagnation rule
is defined as the artificial increase in each iteration that represents the distance from the current position
of an agent
that has presented a stagnant state
. This can be described as follows:
Figure 3 shows an example of the effect of the stagnation rule.
Figure 3a displays the distance map representing the environment. As shown, agent
is at position
, blocked by three obstacles at
, and
. Under these circumstances, agent
would be stuck in this position without being able to move further. By applying the stagnation rule, the distance value
of the position where agent
is located will be artificially increased. Following this rule, after 2 iterations, the distance value of the position will increase from 2 to 4 units. With this new distance value, when the movement rule is applied, the agent will move to a new cell
, which has a smaller distance (
) than
after the increments. This example demonstrates how the stagnation rule enables the agent to overcome obstacles and continue moving toward the exit, thus preventing it from remaining indefinitely stuck.
3.2.3. Behavioral Rules
The behavioral conditions of individuals, such as accidents (
), hysteria (
), and disorientation (
), play a crucial role in the evacuation of a physical space. Accidents (
) can lead to injuries and obstacles, slowing down the evacuation process and creating areas of congestion. Hysteria (
), driven by panic and fear, can cause chaotic and unpredictable behaviors, such as pushing, stampeding, and ignoring safety instructions, which can further complicate the evacuation. Disorientation (
), often resulting from confusion or unfamiliarity with the environment, can lead individuals to move in the wrong direction or fail to find exits, significantly hindering their escape. According to several studies, in typical evacuation scenarios, no more than 10% of the population experiences behaviors such as accidents, hysteria, or disorientation [
41,
42,
43]. However, this percentage can be adjusted based on changing conditions within the population, such as increased stress levels or external factors, or the model can be adapted to specific behavioral characteristics of different groups. By allowing the adjustment of this value, the model gains flexibility, making it applicable to a wider range of real-world situations and enabling more accurate simulations of different evacuation dynamics. This adaptability is crucial for tailoring the model to specific environments or population behaviors, providing more relevant insights into evacuation processes.
Considering these behavioral profiles in an evacuation model is essential for accurately simulating real-life scenarios. It allows for the development of more effective evacuation strategies by identifying potential problem areas and improving response plans. Incorporating these elements helps emergency planners and responders anticipate and manage the complex dynamics of human behavior during crises, ultimately enhancing safety and efficiency and potentially saving lives during actual evacuations.
In our model, three rules have been defined to simulate the conditions of accidents (), hysteria (), and disorientation that an agent can experience during the evacuation process. The first step is to determine whether the agent will experience one of these behaviors. This is carried out using a probabilistic test. In this test, a uniformly distributed random number is generated. If the value of is less than or equal to 0.1 (10%), the test is positive, and the agent will experience one of the three behaviors: or . If the value is greater than 0.1, the agent will not experience any of these behaviors. This probabilistic approach ensures that only a subset of agents will exhibit these behaviors, reflecting the varied and unpredictable nature of human reactions in real-life evacuation scenarios.
Once it has been decided that agent will experience one of the three behaviors , and , one of them is randomly chosen with equal probability to choose one of the three.
If the
condition is selected as the behavior of agent
, the accident rule
is triggered. Under
, the agent
is considered to have suffered an accident or injury, rendering the agent immobile. As a result, agent
remains as an obstacle
in the cell
it occupies on the grid. This means that the agent will block the cell for the remainder of the simulation (for the rest of the iterations), preventing other agents from moving through or occupying that cell.
can be described as follows:
This rule simulates the impact of accidents during evacuation, highlighting how injuries can create additional barriers and complicate the evacuation process, thereby providing a more realistic and challenging scenario for emergency planning and response strategies.
If condition
has been selected as the behavior of agent
, the hysteria rule
is triggered. According to this rule, agent
remains as an obstacle in the same position for a fixed number of iterations
(
). During this period, the agent is immobilized, effectively blocking the cell,
, it occupies and impacting the movement of other agents around it. After the specified number of iterations
has passed, agent
assumes a normal behavior and can move according to the standard movement rule (
), just like any other agent.
can be described as follows:
This rule simulates the temporary paralysis or irrational behavior that can occur due to hysteria, providing a more realistic depiction of how panic can affect evacuation dynamics and potentially cause temporary bottlenecks or delays.
If condition
is selected as the behavior of agent
, the disorientation rule
is triggered. This rule affects the agent for
iterations. During this period, the agent becomes confused and moves erratically from its current position
to another random cell
within its neighborhood
. In this rule, the agent will randomly move to any neighboring cell, regardless of the distance values, with the only restriction that the cell is not occupied.
can be described as follows:
This rule emulates the disorientation that can occur for an individual during the evacuation process, causing the agent to make seemingly irrational moves that do not necessarily lead towards the exit. This rule helps to model the impact of confusion and lack of spatial awareness on the evacuation process, adding another layer of realism to the simulation by accounting for the unpredictable nature of human behavior in emergency situations.
3.3. Computational Procedure
This section discusses the complete computational procedure of the agent-based model to emulate the evacuation process. All operations are detailed in pseudocode in Algorithm 1 and
Figure 4. The method starts by initializing its general operating parameters (line 1), such as the size of the grid (
), the number of people in the room to be evacuated (
), the number of iterations that the agents could be disoriented according to the disorientation rule (
), and the maximum number of iterations (
) for which the evacuation process will be displayed. The initialization parameters are critical as they define the simulation environment and the conditions under which the evacuation will occur. The grid size
determines the spatial layout, while the number of agents
represents the population to be evacuated. The disorientation iterations parameter
specifies the duration of confusion for affected agents, and the maximum iterations
parameter limits the simulation’s runtime, ensuring it remains computationally feasible. This comprehensive setup allows for a detailed analysis of the evacuation dynamics, capturing the effects of various behaviors and environmental factors on the overall process.
To construct the environment (line 2), the simplest method is to generate an binary image of the enclosure plane with values of 0 and 255. In this binary grid, cells with a value of zero represent points that can be occupied by an individual, indicating free space within the environment. Conversely, cells with a value of 255 represent obstacles (), indicating spaces that cannot be occupied by individuals. This binary image approach allows for a clear and straightforward representation of the physical layout, distinguishing between navigable areas and impassable barriers. By defining the environment in this manner, the model can easily simulate movement, interactions, and the impact of obstacles on the evacuation process, providing a realistic and manageable framework for analyzing evacuation dynamics.
The next step is the construction of the distance map
using the Chamfer method (line 3). It is applied over the generated
binary image of the environment. In this image, cells with a value of zero represent navigable space, and cells with a value of 255 represent obstacles. The Chamfer method is then applied to this binary grid to calculate the shortest path distances from each cell to the nearest exit or target point.
Algorithm 1 Pseudocode of the proposed method |
1: | Input: , , |
2: | EnvironmentConfiguration() |
3: | ChamferAlgorithm() |
4: | for iteration=1: |
5: | | for =1: |
6: | | Rule_() |
7: | | Rule_() |
8: | | Rule_() |
9: | | Rule_() |
10: | | Rule_() |
11: | | end for |
12: | end for |
13: | Output: |
Once the distance map is created, a cycle is initiated that is repeated for a maximum number of iterations. This number represents the number of visualizations that will be made of the evacuation process. During each iteration, all agents are processed. Each of the five rules is applied to each agent (lines 5–10). These rules include the movement rule (), stagnation rule (), accident rule (), hysteria rule (), and disorientation rule (. Each rule is applied only if the conditions for its application are met; otherwise, only the necessary rules are applied. Each application of a rule modifies the state of the grid by moving individuals within the space, trying to reach the exit. Agents will navigate towards the exit based on the distance map, adjust their paths to avoid obstacles and other agents, and react according to their specific behavioral conditions (accidents, hysteria, or disorientation). The model continues this cyclic application of rules until the maximum number of iterations is reached, providing a detailed simulation of the evacuation process and the dynamic interactions within the environment.
4. Experimental Results
This section demonstrates the capabilities and flexibility of the proposed agent-based evacuation model through a series of structured experiments. Each experiment is designed to evaluate the model’s performance in various complex environments: a real-world scenario at the Hospital “Civil Viejo Fray Antonio Alcalde” in Guadalajara, Mexico, a maze, and a train station. These scenarios were specifically chosen to illustrate the model’s adaptability to different spatial complexities and emergent behaviors of agents under varied conditions.
The experimental section includes a set of simulations where the performance of the model is analyzed under different conditions, such as varying numbers of agents and their behavioral states—including hysteria, collective learning, and disorientation. For each environment, we present six snapshots, illustrating the evolution of the evacuation process at significant intervals. This visual information aids in understanding how the agents interact with the environment and with each other, highlighting the model’s ability to identify critical risk areas and optimize evacuation strategies effectively. By observing these images, we can analyze the dynamic patterns of movement, congestion points, and the effects of different behaviors on the overall efficiency of the evacuation process. This approach ensures a thorough evaluation of the model’s robustness and practical applicability in diverse disaster scenarios.
Furthermore, the model’s robustness is validated by testing its applicability across these distinct scenarios, demonstrating its potential to be employed in any setting that requires evacuation planning and safety analysis. The following discussions and visual representations (
Figure 5,
Figure 6 and
Figure 7) provide a comprehensive insight into the dynamics of evacuation, emphasizing the model’s innovative approach to enhancing building safety in emergency situations. The following experiments in this section were implemented using MATLAB, running for an average time of 141 s on a computer with the characteristics shown below.
Device: Huawei Matebook E.
Processor: 11th Gen Intel(R) Core(TM) i7-1160G7 @ 1.20 GHz 2.11 GHz.
OS: Windows 11 Home.
RAM: 16 GB.
SSD: 512 GB.
GPU: 8 GB Intel(R) Iris(R) Xe Graphics.
To better understand the implications of the experimental results, it is crucial to consider the real-world equivalent of the agents’ movements within the simulated environments. Human walking speed averages around 1.4 m per second (m/s), which equates to approximately 5 km per hour (km/h). In the proposed model, agents move one cell per iteration, where each cell represents a pixel in the environment. The environments are scaled to 100 × 100 pixels, and in the case of the Fray Antonio Alcalde Hospital, to 160 × 160 pixels, reflecting its actual size of 160 m by 160 m.
4.1. Fray Antonio Alcalde Hospital Environment
For Experiment A (
Figure 5), conducted in the Fray Antonio Alcalde Hospital environment, 1500 agents successfully evacuated the 160 × 160 pixel hospital through 10 designated exits in 278 iterations out of a total of 500 iterations. The 500 iterations were executed in 102.448458 s. To translate this into real-world terms, considering the hospital’s actual dimensions and the average human walking speed, the 278 iterations correspond to the agents traversing 278 pixels, or approximately 278 m. Given that the average walking speed is 1.4 m per second, this translates to approximately 198.57 s (278 m/1.4 m per second) in real-world evacuation time, which is about 3.31 min.
In a real-world evacuation drill at the Fray Antonio Alcalde Hospital, 320 employees and 956 users were evacuated in ten minutes. The drill involved 80 personnel from security, stretcher-bearers, and Civil Protection brigades [
44]. It is important to note that in the real drill, some users required assistance as they were hospitalized patients, which added complexity to the evacuation process. This highlights the practicality and efficiency of the model in simulating real-life scenarios where different levels of assistance are required.
Figure 5 illustrates the iterative evolution of the Fray Antonio Alcalde Hospital environment with 1500 agents:
Figure 5a shows the initialized environment in the first iteration with agents randomly distributed within the hospital.
Figure 5b shows the progress at iteration 25, where patterns and agent followings start to emerge. Clusters of agents are indicated by colors: white for single agents with no obstructions, green for two agents nearby, yellow for three agents, orange for four agents, and red for five or more agents in a zone. This color-coding helps identify bottleneck areas where experts can plan infrastructure improvements to increase evacuation flow and prevent congestion.
Figure 5c shows the environment at iteration 50.
Figure 5d shows the system at iteration 100.
Figure 5e shows the environment at iteration 200, where approximately 17 agents remain in the system.
Figure 5f shows the environment at iteration 350, with the area now clear and circles indicating zones of highest agent concentration.
Figure 5g presents a graph of the system’s evolution, showing the evacuation progress of agents over iterations, with all 1500 agents evacuated by iteration 278.
Figure 5h displays the map with optimal evacuation routes, allowing experts to identify the best paths for evacuating the environment. These optimal routes are determined by the emergent behaviors that arise within the agent-based model. As agents move through the environment, their collective behaviors naturally converge towards paths that offer both the shortest distance to the exits and the least congestion. This emergent behavior reflects how individuals adapt to both distance and crowd density, leading to the formation of the most efficient evacuation routes.
The results of experiment A conducted in the Fray Antonio Alcalde Hospital environment reveal an interesting correlation between the model evacuation time and the times reported in the real scenario. Although the evacuation time in the model is approximately 3.31 min and the time reported in the real scenario was 10 min, it is important to consider the factors that contribute to this difference. In the real simulation, various elements such as inpatient care, delays in communicating instructions, and the physical limitations of some patients slow down the evacuation process. In contrast, the agent-based model in its first simulations obtained similar evacuation times; however, as emergent events arose and the model was retrained, the evacuation routes were optimized and the agents evacuated the environment in considerably less time. In addition, the emergent behaviors observed, such as the formation of congestion points (
Figure 5f), highlight areas where improvements could be made to the infrastructure of the Fray Antonio Alcalde Hospital to increase evacuation efficiency. For example, areas of high agent concentration could be improved by widening exits, optimizing corridors, or placing evacuation signs to help distribute the flow more uniformly. The routes identified as optimal (
Figure 5h) allow the generation of strategic evacuation plans. The model also demonstrates a strong ability to mimic human behaviors in evacuation situations, such as grouping and adaptive movement according to local conditions. These behaviors validate the effectiveness of the proposed model to simulate complex evacuation scenarios, providing practical recommendations for building planning and optimization of evacuation procedures. Finally, the ability to identify critical areas of congestion allows experts to propose adjustments to evacuation strategies, highlighting the usefulness of the model for safety planning in high-traffic environments.
4.2. Maze Environment
For Experiment B (
Figure 6), conducted in a maze environment, 1000 agents were tasked with evacuating through three designated exits in a 100 × 100 pixel maze. The agents successfully evacuated the maze in approximately 2000 iterations, which took around 230 s in simulation time. To translate this into real-world terms, considering the maze’s actual dimensions and the average human walking speed, the 2000 iterations correspond to the agents traversing 2000 pixels, or approximately 2000 m. Given that the average walking speed is 1.4 m per second, this translates to approximately 1428.57 s (2000 m/1.4 m per second) in real-world evacuation time, which is about 23.81 min.
This model can be run multiple times to train the agents, which helps in reducing evacuation time. Through repeated simulations, agents can discover the optimal routes, and collective behaviors enable agents to follow those who have already identified the best paths.
Figure 6 illustrates the iterative evolution of the system:
Figure 6a shows the initialized environment in the first iteration with agents randomly distributed within the maze.
Figure 6b shows the progress at iteration 500, where some evacuation routes start to become apparent.
Figure 6c shows the environment at iteration 1000.
Figure 6d shows the system at iteration 1500.
Figure 6e shows the environment at iteration 2000, where only five agents remain in the maze.
Figure 6f shows the end of the 2500 iterations, with red circles indicating zones with the highest agent concentration.
Figure 6g presents a graph of the system’s evolution, showing the evacuation progress of agents over iterations.
Figure 6h displays the three routes found by the agents to exit the maze.
This experiment highlights the model’s capability to handle complex environments and its effectiveness in finding optimal evacuation routes even in constrained and intricate layouts like a maze.
The results of Experiment B in the maze environment demonstrate the model’s capability in complex scenarios. The evacuation time of 23.81 min, although longer than in less complex environments, highlights the complexity of the environment. The need for agents to move through multiple paths and dead ends significantly affects evacuation time, delaying the evacuation process. One of the strengths of the proposed model is its ability to improve evacuation times through repeated simulations, which allow agents to be retrained, resulting in better routes that emerge from collective emergent behaviors. The emergent behavior observed in this experiment, where agents follow those who have already discovered the optimal routes, mimics real-world behavior, where individuals tend to follow others in uncertain situations. This adaptive learning process, as seen in
Figure 6h, highlights the importance of training agents to efficiently navigate complex environments. Moreover, the identification of three main evacuation routes (
Figure 6h) further underscores the model’s effectiveness in managing complex environments. These routes provide valuable insights into how bottlenecks can be avoided and how to optimize the flow of evacuees in environments with limited exit points. Finally, the model’s applicability offers practical insights for real-world safety planning in complex structures such as large office buildings and shopping malls. The ability to repeatedly simulate and optimize evacuation strategies makes this model a valuable tool for emergency preparedness and infrastructure design.
4.3. Train Station Environment
For Experiment C (
Figure 7), conducted in a 100 × 100 pixel train station environment with two exits and a mini labyrinth representing the platform change, 1500 agents were tasked with evacuating. The agents successfully evacuated the system in approximately 450 iterations out of a total of 1000 iterations, which took around 92 s in simulation time. To translate this into real-world terms, considering the average human walking speed of 1.4 m per second, the 450 iterations correspond to the agents traversing 450 pixels, or approximately 450 m. This translates to approximately 321.43 s (450 m/1.4 m per second) in real-world evacuation time, which is about 5.36 min.
Figure 7 illustrates the iterative evolution of the system:
Figure 7a shows the initialized environment in the first iteration with agents randomly distributed within the train station.
Figure 7b shows the progress at iteration 50, where evacuation routes start to become visible.
Figure 7c shows the environment at iteration 200, where disoriented and hysterical agents were blocking other users. In this iteration, some of the agents have found the route to the exits.
Figure 7d shows the system at iteration 250.
Figure 7e shows the environment at iteration 300.
Figure 7f shows the system at iteration 600, with a circle indicating the bottleneck congestion zone.
Figure 7g presents a graph of the system’s evolution, showing the evacuation progress of agents over iterations.
Figure 7h displays the evacuation routes generated by the agents.
This experiment demonstrates the model’s capability to manage complex environments with obstacles and bottlenecks, highlighting its effectiveness in finding optimal evacuation routes and dealing with agent behaviors such as disorientation and hysteria that can impact the evacuation process.
The results of Experiment C in the train station environment reveal an interesting emergent behavior that highlights the model’s ability to simulate adaptive decision-making during evacuation. Initially, most agents followed the collective behavior, moving toward the nearest exit. This behavior, observed in
Figure 7b, led to the formation of bottlenecks and a high concentration of agents near the exit, delaying the evacuation for those at the back of the group. However, a notable observation was the behavior of agents who, upon encountering congestion, decided to explore alternative routes (
Figure 7c), even if they were slightly farther away. These agents, by avoiding the bottleneck and opting for a less congested exit, managed to evacuate more quickly than those who continued following the collective route. This adaptive response is an interesting feature of the model, as it mimics real-world behavior where individuals reevaluate their decisions when faced with obstacles or delays. The emergent behavior of agents self-organizing into groups that either follow the majority or explore alternative routes demonstrates the model’s flexibility in handling complex environments with dynamic conditions. Moreover, the presence of disoriented and hysterical agents (
Figure 7b), who temporarily blocked others, illustrates how psychological factors can influence the overall efficiency of the evacuation process.
4.4. Discussion
The experimental results highlight several key findings about the behavior of agents under varying conditions and the corresponding effects on evacuation efficiency. In all scenarios tested, from the confined spaces of a room to the complex environments of hospitals, mazes, and train stations, we observed that increasing the number of agents generally exacerbated congestion, which in turn prolonged the evacuation times. This correlation underscores the importance of optimal agent density calculations in emergency planning to prevent dangerous bottlenecks. In addition, the introduction of complex behavioral states such as hysteria and disorientation added significant variability to the agents’ behavior. These states were designed to simulate real human responses in panic situations:
Hysteria: Agents experiencing hysteria tended to freeze or move unpredictably, causing sudden halts and disruptions in the flow of movement, which could create localized congestion. However, this behavior also led to the emergence of alternative paths as other agents navigated around the immobilized individuals, sometimes resulting in faster evacuation routes being identified.
Disorientation: Disoriented agents often took inefficient paths or circled back on themselves, which increased their individual evacuation times. Interestingly, this sometimes-dispersed crowds more evenly across the available exits, reducing pressure on any single exit point.
Moreover, the variability introduced by different states sometimes facilitated unexpected, beneficial emergent patterns. For instance, when certain agents altered their routes in response to blocked paths or congested areas, they often inadvertently discovered more efficient pathways. These emergent behaviors highlight the potential of agent-based models to identify innovative evacuation strategies that might not be immediately obvious in standard planning procedures.
One of the most practical outcomes of this study was the model’s ability to identify potential risk zones areas where overcrowding is likely or where unusual behaviors frequently emerge. Such zones are critical points for infrastructural or procedural intervention. Based on the simulation, we can recommend specific areas within each environment for capacity enhancement, structural modification, or targeted evacuation drills.
The insights garnered from these experiments have profound implications for emergency evacuation planning. By understanding how agents respond to different layouts and stimuli, planners can better design evacuation protocols that are not only efficient but also resilient to the unpredictable elements of human behavior. Furthermore, the ability to simulate various scenarios allows for the testing of emergency response strategies in a risk-free environment, ensuring that procedures are optimized before they are needed in real-world situations.
4.5. Model Applicability and Novel Contributions
The proposed agent-based model introduces innovative aspects to the field of evacuation modeling, notably through its dynamic adaptation of agent behaviors, which are influenced by both environmental changes and interactions with other agents. Unlike static models, this dynamic approach allows for real-time adjustments in agent strategies, enhancing the realism and applicability of the model in diverse emergency scenarios. The flexibility of the model is demonstrated through its ability to seamlessly adapt to a variety of environments, from the constrained layouts of rooms and buildings to the complex settings of hospitals, mazes, and train stations without the need for significant modifications. This adaptability makes it an invaluable tool for safety engineers and emergency planners who must prepare for a wide range of emergency situations. Moreover, the model’s capacity to simulate detailed agent interactions and complex behavioral dynamics offers profound insights into crowd behavior under stress. The simulation of psychological states such as hysteria, disorientation, and collective learning reveals emergent patterns that can both hinder and facilitate the evacuation process. These patterns provide critical information for identifying risk zones and optimizing evacuation routes, thereby improving overall building safety and emergency response strategies. The scalability of the model and the detailed visualization of evacuation progress through iterative graphics further enhance its practical utility. These features allow planners to visualize potential evacuation scenarios and develop strategies that are informed by a comprehensive understanding of agent behaviors and environmental influences.
5. Conclusions
This paper presented an evacuation model that utilizes agent-based approach, which employs only five rules to capture the interactions between individuals in an environment with obstacles and exits. This model not only demonstrates the movement of agents during the evacuation process in response to changing environmental conditions but also illustrates the consequences of unpredictable agent behavior caused by accidents, hysteria, and disorientation. This approach differs from many conventional evacuation models by incorporating rules that simulate typical behaviors observed in complex evacuation scenarios, such as accidents, panic, and confusion. By integrating these behavioral factors, the model provides a more accurate representation of how people actually respond during evacuations, resulting in more true-to-life and practical outcomes. To validate the effectiveness of the proposed agent-based model, a series of comprehensive experiments and case studies focusing on diverse urban settings were conducted. The experiments include the Hospital “Fray Antonio Alcalde”, a maze, and a train station. They demonstrate the model’s flexibility and effectiveness in different spatial complexities.
In the Fray Antonio Alcalde Hospital environment, 1500 agents successfully evacuated through 10 designated exits, highlighting the model’s ability to simulate real-world scenarios where varying levels of assistance are required. The maze experiment showed how agents navigate through complex environments with multiple exits, emphasizing the importance of optimal route discovery and collective behavior in reducing evacuation times. The train station experiment further validated the model’s robustness in handling environments with bottlenecks and obstacles, demonstrating its capability to adapt to disorientation and hysteria among agents.
An example of the model’s ability to identify innovative evacuation strategies can be seen when agents encounter unexpected blockages or congestion during their movement. For instance, in the train station experiment, agents initially faced a crowded or blocked path, forcing them to reroute through less obvious corridors. This adaptive behavior led them to discover a more efficient, less congested exit route. Such emergent patterns, which might not be immediately apparent in static planning, highlight the model’s potential to reveal alternative evacuation strategies through real-time agent interactions.
The model’s adaptability is further exemplified by its potential application to large-scale scenarios, such as the hypothetical 7.2 magnitude earthquake scenario affecting the University of Guadalajara. In this scenario, 190,000 people were evacuated in the morning session, with additional evacuations planned for the afternoon, totaling over 350,000 participants [
45]. This case underscores the model’s scalability and its utility in planning and optimizing evacuation strategies for large populations in various urban contexts.
The agent-based model’s dynamic adaptation, detailed visualization, and real-time adjustments make it a powerful tool for safety engineers, emergency planners, and civil protection agencies. By providing a comprehensive understanding of agent behaviors and environmental influences, the model enhances the ability to identify risk zones, optimize evacuation routes, and improve overall building safety in emergency situations.
Future work will focus on refining the model to incorporate more detailed psychological factors and exploring its application in other urban environments. This ongoing research aims to contribute to the development of safer and more efficient evacuation strategies, ultimately enhancing public safety in smart cities worldwide.