**3.2 Bring the concept to life: Computational model**

The computation model is the transposition of the conceptual model to the computational realm. In order to achieve such transition, there are two major choices. The first choice is building the whole simulation program and framework by hand. In other words, the developer could write all the elements of the simulation and a framework to manage the simulation.

#### **3.2.1 Implementation details**

This simulation was entirely written in the Java programming language. As it was described in Section 2.2, each agent (Person, Exit, Threat and Obstacle) was modeled as a Java class.

The framework used to implement this model was the Swarm Framework, found at (SwarmTeam, 2008). The database engine used to store the simulation statistical data was the HSQLDB (Hsqldb Development Group, 2009), a free and open-source database engine written in Java.

A simple log system was also designed and it could be set up to store step-by-step state data for all agents or just for a set of them. The log data was stored using the YAML standard for better human readability than CSV or XML.

In order to answer this question, a discussion about the definition of disaster must happen. Once again, Quarantelli provided a study about disasters and earthquakes in (Quarantelli, 1981). The first part of the aforementioned paper pondered about the definition of disaster

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

According to Quarantelli, some researchers have a biased and habitual view of disasters which partially blinds them from other possibilities. There would be two ways of analyzing disasters: focusing in the agents that caused the disaster or taking a more generic approach. Quarantelli identified seven conceptions of disaster. Each conception analyzes disaster events through different approaches. Some of these approaches are related, but they are focused in

**Physical Agents** This conception accepts a disaster whenever its primary cause is identified. And it seems natural that the cause for an earthquake is different from the cause of fire. The focus is pointed at the physical agent that caused the disaster. Such agent (the cause) must be described in detail, and the knowledge about one agent does not help in analyzing

**Physical Impact of the Physical Agent** Whenever there is a noticeable physical impact in some part of the environment, the disaster is identified. The physical agent is no longer relevant, but how this agent affects the environment. Instead, how the physical agent's features in the geological, biological and social-technical spheres of the environment affect

**Assessment of Physical Impacts** While the first conception deals with the physical cause alone and the second conception analyzes the impact of such agent in the environment, this conception understands the disaster by the assessment performed on the physical impact. Thus, an event can only be called a disaster if the physical impact crosses a certain benchmark or threshold defined in an assessment. For instance, an earthquake could only be called a disaster if its strength - measured in the Mercalli and Richter scales - goes

**Social Disruptions Caused by an Event with Physical Impact** For this disaster conception, if the physical impact also causes a social disruption of the social life - represented by dead bodies and wrecked buildings, for example - the event is treated as a disaster. Following this conception, in order to identify a disaster, a social disruption (disorganization) must happen due to some physical impact, and the disaster will be graded by the social

**Social Construction of Reality in Perceived Crisis** The previous concepts take the physical element into consideration for defining a disaster. It is assumed that some physical event happened and that triggered the disaster, be it directly, by its impact, by an assessment or by the resulting social disruption caused by the impact. The physical component takes distinct roles in each definition, but it must always be present. The conception of disaster as a social construction of reality takes the people's perception as the key element to identify some event as a disaster. There is no need for physical evidence. If people believe that the situation is dangerous and poses as a threat to life, property, well-being or social order, the event is accepted as a disaster. Quarantelli stated that this approach makes the disaster a relativistic term rather than an absolutist one. Different groups may interpret the same

another one. Distinct agents require completely distinct studies;

the impact becomes more relevant than the agent itself;

beyond an established level and it becomes notable;

and how researchers usually face the matter.

distinct elements of the disaster:

disruption;

event as a disaster or not;

Fig. 8. Simulation Screen Shot

The Swarm Framework does not provide an Expert Systems' support, so the JESS (Friedman-Hill, 2009) (Java Expert Systems Shell) library was applied. FuzzyJ (Brown, 2009) was used for the fuzzy logic rules.

In order to keep the simulation "random" and controlled at the same time, a set of ten random seeds were chosen. Since the simulation was run ten times, for each simulation run a specific random seed was used to keep the simulation analysis consistent.

The usage of a multi-agent simulation framework as Swarm allows the developer to think more about the simulation itself rather than the crosscut concerns, such as graphics. Figure 8 shows a screen shot of the simulation. All the graphical elements were drawn by Swarm Framework. Each colorful dot represents an agent, while the red area on the left is the threat (fire in this example).

Since the model is social-cognitive, the best validation approach is by analyzing the dynamic behavior of the simulation and checking if such behavior is coherent with the theory. The data gathered during the simulation combined with its dynamic behavior is used to validate the conceptual model. Swarm displays the physical environment as an animated 2D grid (lattice), and such animation provides the dynamic aspects of the simulation.
