**3. A simulation model for panic in crowds phenomenon**

### **3.1 From theory to practice: Conceptual model**

12 Will-be-set-by-IN-TECH

The Computation Model is the representation of the Conceptual Model in a programming language or simulation tool so that model can be evaluated and analyzed. The process of building the computation model is similar to application software development. Usually, the same tools are employed, such as text editors, integrated development environments (IDE's),

The usage of a simulation framework allows the developer to keep her focus on the model and the simulation details instead of the programming language and running environment details. There are many simulation frameworks available, such as Repast, NetLogo and Swarm. Most of these frameworks can be combined with other tools and libraries. For instance, the Swarm Framework SwarmTeam (2008) is written in Objective-C and it also supports Java for simulation building. Since a simulation could be written in Java, it would be possible to use Java-based libraries - such as JESS Friedman-Hill (2009) - to enhance Swarm agents and the

Usually, the simulation developer must create objects that represent her agents. The agents'

• The choice of a random number generator or the creation of a customized one. Some frameworks provide a generator. However, for some specific situations, a generator created from scratch must be required. Although they are called "random", in reality they are pseudo-random, and that happens for a reason: a simulation (even multi-agent based) usually requires numbers that set the simulation up and could be fed during the simulation process. The developer must be in control of the numbers' generator to avoid

• The usage of supplementary tools that might aid the simulation process and the post-process. These tools include databases, graphical viewers and network facilities, among others. Just like the random number generator, some frameworks provide these tools. It is up to the developer to choose either the tools found in the framework or to

An aspect of great relevance in simulations is how accurately the conceptual model and the computational model depict the target system. Two processes can be used to check such

The first process is called validation. Its main purpose is to make sure that the conceptual model represents the target system in a certain (and desirable) level of precision and to show

Verification goal is to certify if the conceptual model was rightfully implemented (translated) in the computation environment. Since a computer simulation works as a software application, it is possible to use software engineering tools, such as unit tests, to certify that the behavior designed for the simulation (found in the conceptual model) really happens in

variables become the objects' fields. Likewise, the agents' actions become methods.

The simulation developer may face some challenges, such as:

an excessively predictable behavior and a fully random behavior;

create them on her own , or even mix the best tools from both sides;

whether the simulation's results match the target system Ruas et al. (2011).

**2.2.4 Computational model**

simulation as a whole.

**2.2.5 Verification and validation**

confidence.

the software execution.

testing tools, graphics libraries and so on.

In order to build a conceptual model for the panic in crowds' phenomenon the following elements will be discussed:


This model proposes the interactionism approach presented by authors such as Blumer (Section 2.1.3). A generalized flow based on that theory is shown in Figure 2. It is worth noticing that the exhibition of the steps is in a sequential order for didactical purposes. However, it is possible that a person follows a distinct order, not performing some steps or repeating others.

#### **3.1.1 Model's environments**

#### 3.1.1.1 General environment

This element represents a general overview of the environment where all the interactions among agents will happen, and it has the Physical Environment, the Communication Environment and the Collective Mind. Its purpose is defining the boundaries of the other environments and their linking points. Figure 3 shows the proposed diagram for the relationship of these elements.

#### 3.1.1.2 Physical environment

The Physical Environment describes the space where the physical interactions among agents occur, as well as the interactions between the agents and the other objects such as obstacles and walls. There are specific spots for the threat and the exits. Figure 4 shows this environment

diagonally if required.

heat diffusion between cells.

This environment, along with the Person agent, also has the Obstacle, Threat, Exit, Milestones and Fire Spot agents. An Obstacle blocks people's passage, forcing them to dodge. In the model described in (Helbing et al., 2002), the building structures (walls and pillars) and the

Simulating Collective Behavior in Natural Disaster Situations: A Multi-Agent Approach 449

The Threat agent is the element that triggers the exciting event in a panic situation. For the model described in (dos Santos França, 2010) in particular, it is a fire incident modeled by a structure that represents the environment's heat as a 2D grid. Such structure is responsible for

The Exit is the physical environment's safe haven. When the Person agent arrives on that place, he does not feel threatened and he gets disengaged from the collective behavior, which

Milestones bound Threat's influence zones and they serve as reference to the emergent behavior analysis. Fire Spots are fire's control points that establish how far the fire went through the environment. Along with the Milestones, the Spots can help in outlining potentially safe or dangerous zones, working as if buzzers and visual alarms were triggered by a smoke detector. However they do not exist physically; they are just the representation of

The Communication Environment manages and serves as medium for the three communication forms among the agents: through the environment (physical perception), directly (sender/receiver model) and indirectly (dissipation/perturbation). In this third form, whenever an agent wants to communicate with another, it places the message on the environment (dissipate) and if another agent may be disturbed by that message or not. That occurs because it is not possible to control the expectations and actions from the other agents and assures that the communication will happen *a priori* Figure 5 shows the Communication

**-**


 -

 **-**


 


 - --

 **-**

 

 

A Blackboard system (Rich, 1988) was used for the direct and indirect messages. Physical


 -

 

wounded and immobilized individuals are treated as obstacles.

makes him no longer relevant for the simulation.

the agents' response to such elements. 3.1.1.3 Communication environment

Fig. 5. Communication Environment.

information was gathered directly from the environment.

Environment.

Fig. 2. Collective Behavior General Flux (dos Santos França, 2010).

Fig. 3. General Environment and its Components (dos Santos França, 2010).

Fig. 4. Physical Environment (dos Santos França, 2010).

The agents can move in four directions (north, south, east or west). Besides, there is a chance of lane change according to agents' traffic during the simulation, which makes the agent moves diagonally if required.

14 Will-be-set-by-IN-TECH

**-**

**!-**

**-**

**-**

**-**

**-** 

 

Fig. 2. Collective Behavior General Flux (dos Santos França, 2010).



**-**

Fig. 4. Physical Environment (dos Santos França, 2010).

**--**

 -

Fig. 3. General Environment and its Components (dos Santos França, 2010).


**--**

The agents can move in four directions (north, south, east or west). Besides, there is a chance of lane change according to agents' traffic during the simulation, which makes the agent moves








 

**-**

**-**

 -

 

 

-

This environment, along with the Person agent, also has the Obstacle, Threat, Exit, Milestones and Fire Spot agents. An Obstacle blocks people's passage, forcing them to dodge. In the model described in (Helbing et al., 2002), the building structures (walls and pillars) and the wounded and immobilized individuals are treated as obstacles.

The Threat agent is the element that triggers the exciting event in a panic situation. For the model described in (dos Santos França, 2010) in particular, it is a fire incident modeled by a structure that represents the environment's heat as a 2D grid. Such structure is responsible for heat diffusion between cells.

The Exit is the physical environment's safe haven. When the Person agent arrives on that place, he does not feel threatened and he gets disengaged from the collective behavior, which makes him no longer relevant for the simulation.

Milestones bound Threat's influence zones and they serve as reference to the emergent behavior analysis. Fire Spots are fire's control points that establish how far the fire went through the environment. Along with the Milestones, the Spots can help in outlining potentially safe or dangerous zones, working as if buzzers and visual alarms were triggered by a smoke detector. However they do not exist physically; they are just the representation of the agents' response to such elements.

#### 3.1.1.3 Communication environment

The Communication Environment manages and serves as medium for the three communication forms among the agents: through the environment (physical perception), directly (sender/receiver model) and indirectly (dissipation/perturbation). In this third form, whenever an agent wants to communicate with another, it places the message on the environment (dissipate) and if another agent may be disturbed by that message or not. That occurs because it is not possible to control the expectations and actions from the other agents and assures that the communication will happen *a priori* Figure 5 shows the Communication Environment.

Fig. 5. Communication Environment.

A Blackboard system (Rich, 1988) was used for the direct and indirect messages. Physical information was gathered directly from the environment.

3.1.2.2 Hybrid Belief-Knowledge Management Module

agent's demand (dos Santos França, 2010).

belief to knowledge) during the simulation.

and their values do not change during the simulation.

Figure 7 shows how a graphical view of such table.

Table 1. Dangerousness Levels for Fuzzification.

Fig. 7. Fuzzification Graph

 

agent's general behavioral rules.

scale.

The module that manages the information bases and the rule set of the Person agent is the Hybrid Belief-Knowledge Management Module (HBKMM). The information can be modeled by a stochastic, logical or a fuzzy approach that is used because some information kept by the HBKMM is imprecise and incomplete by nature. Since there is fuzzy information, a Fuzzy Process is also required so the information can be fuzzified and de-fuzzified according to the

Simulating Collective Behavior in Natural Disaster Situations: A Multi-Agent Approach 451

The Rules and Information Repository groups the Information Store that keeps the beliefs, knowledge and the micro collective representation, and the Rule Set which holds the Person

The Information Storage holds deterministic (analyzed using equations or algorithms), probabilistic (that follows a stochastic uncertainty that defines whether it is truth or not or fuzzy information - that deals with the possibility of the information being truth or not in a

The Knowledge Base stores the information that are treated as secure and confirmed by the agent. In model shown in (dos Santos França, 2010), if the information requires physical evidences, but the agent could not be able to get the evidences using its own perception, then the information is treated as a belief. Thus, the agent's variables can do a status change (from

The agent' personal features define the state of the agent. They are variables that change their value according to the information gathered by the agent and the agent's actions and processing. There are also constant features that were defined before the simulation started

An example of the agent's variable is the Dangerousness. It is a complex variable that relies on other variables of the agent, such as distance from the threat, health, the agent's experience on this kind of hazardous phenomenon, among others. Considering that this variable has fuzzy information, in order to be fuzzified and de-fuzzified a fuzzification table (Table 1 is used.

> 0.10 0.50 Slightly dangerous 0.45 0.80 Mildly dangerous 0.75 1.00 Imminent Life Threat

> > - - -

 

**Zone Value** 0.00 0.20 Safe
