**1. Introduction**

Pakistan is one of the countries that has been badly affected by disasters in the last two decades. Pakistan is the sixth most populated country of the world. Hence, rapid urbanization has led to unchecked growth of small cities. These cities are growing without well-planned infrastructure, which is the root cause of urban disaster [1,2]. In populated cities, various incidents of road accidents and fire breakouts are causing hundreds of deaths and property damage at multiple levels. Modern countries around the world have worked very hard to manage the disasters while in developing countries, the efforts made are not up to the required standards. The degree of human suffering is the only thing that we have to control, and it is only possible with the significant decrease in risk and initial preparation for risk [3]. At present, the disaster management (DM) system in Pakistan does have a wide-ranging, well-connected arrangement at institutional level, but lacks an efficient, reliable, and speedy response plan. It is due to the reason that there is no effective resource allocation (RA) technique to deal with a disaster situation in accordance with the emerging technological trends. This results in a delayed response by administration. Therefore, whenever an emergency occurs in the region, it would result in huge loss of life, property, and capital.

Authors in [4] have presented a study of a tragedy of Baldia town factory, Karachi. The paper highlights the challenges faces by rescue services in Pakistan. The study is the motivation for our work as it shows the vulnerabilities of Urban Pakistan rescue and government services.

Considering the challenges of Urban Pakistan GIS study of current DM resources and infrastructures is an eminent challenge. Many existing studies have incorporated GIS for modeling and simulation of varied applications. In [5], the authors have established a technique that combines the use of GIS and remote sensing for achieving simulation and modeling of the landscape impact affected by construction. Taking a review of DM practices in Canada, the authors of [6] provided an in-depth investigation of reasons of failure of present DM practices, and suggested the application of knowledge and systems science to improve DM efforts.

Arain in [7] introduces a conceptual framework of knowledge-based methodology for instant and successful economical DM, while it is limited to post-disaster only. ABM has been employed to study human behavior and the complex adaptive effect on the overall system. In [8] the authors have presented a simulation of avoiding behaviors among social groups and synchronize behaviors among subgroups within the same social group.

The article [9] presents the effect of contextual decision making by authorities to reduce the impact of a disaster. The study presents the application of design science research to develop semi-structured DM plans. The research is focused on how the individual and social behavior affects the DM knowledge, which results in different approaches to disaster management. The complex interactions and information flows are modeled using ABM that signifies the application of ABM for DM.

Huang et al. [10] describe a problem under consideration of how humanitarian aid is distributed and delivered to the affected zone in an efficient way through a network of transportation to reduce the disaster effect. However, it is difficult for RA to determine which resources are helpful during allocation. Wise et al. [11] present precise work of several researchers and their opinion about urban framework elements. They are influenced by transportation concerning to ABM. Matveev et al. in [12] explain dependency and proficiency of emergency responses to incidents and other vehicle utilization during the emergency occurrence. In [13] the authors focus on how to deal with location and relocation, as well as dispatching decisions for emergency vehicles. The study highlights that using analytical methods and the inclusion of factors like dynamism and uncertainty makes a system computationally infeasible. In [14], Kong et al. proposed a model which is based on a backpropagation neural network composed of linear programming and RA requirement prediction, but resource management is always pre-assigned in the case of traffic accidents.

In [15], the researcher's consideration is centered on utilizing volunteer resources for mapping the damage. It expresses a spatial prototype that demonstrates an agent-based model using public utilization geographic information system (GIS) data.

Cavdur et al. in [16] has deliberated on a facility location problem for disaster operation management, and the proposed approach for solution is based on a deterministic model. Meng et al. determine the optimal location facilities for the terrorist attack in terms of emergency response in [17]. The study however contains the assumptions of boundless limitations, which are not practical.

In [18] authors address a maximum coverage location problem (MCLP) with partial coverage where distance and demand zones are rectilinear. Therefore, when addressing allocation in an attention zone, the coverage algorithm includes only the part that has relative demands. The authors developed a novel methodology for a specific facilities problem only having multiple objectives with the attention on an emergency location system [19].

Our presented work is aimed at establishing the use of agent-based modeling for disaster mitigation in Pakistan. The motivation behind the study is to provide soundness of using ABM in situations where the lack of data and dense urban maps of unstructured development poses a great challenge in making performance estimates of available resources in the case of emergencies. The rest of the paper is organized into four sections. Section 2 discusses the problem statement. In Section 3, the details of proposed model and two allocation algorithms first come first serve (FCFS) and high

severity level (HSL) are provided. Section 4 presents results of our implemented simulation in NetLogo while Section 5 presents the conclusion and future work.

#### **2. Problem Statement**

Many developing countries have carried out extensive research to develop early warning systems, disaster relief distribution systems, and GIS to enhance their disaster response capacities to deal with adversity. In the field of disaster management, there has been a dire need to create and actualize RA models for improving the current RA techniques in Pakistan. This acute need to assess and devise a feasible RA model at national level will lead to better DM abilities. The problem statement is defined as:

"How to allocate resources for disaster management in an urban area by capitalizing on emerging technologies, to formulate and develop a system model using ABM for RA."

#### **3. Proposed System Model**

In this section, a system model is proposed to allocate resources in the case of disasters. The system model covers planning, strategy, and algorithm-based procedures RA. The model is based on ABM, which is a novel framework made up of self-governing agents and interaction between the agents. In our system, demand and resources are basic agents. An agent can be defined as self-governing, objective-oriented entity fit for watching and collaborating with other agents.

The objective of ABM for RA is to think about emergent complex behavior of the entire system as compared to a centralized decision-making agent the proposed system is a conceptual model utilized for resource allocation to the demands. The proposed model to implement ABM for RA is shown in Figure 1.

**Figure 1.** Conceptual model to implement agent based modeling (ABM) for resource allocation (RA).

## *3.1. Resources*

Resources are organizations that provide emergency services (ambulance, fire brigade, etc.) to the demand site. Resources are required for all events including preventive action, early relief, emergency and disaster reduction.

An estimation of resources expected to achieve the target in terms of demand must be directed. A simple target may require simple resources, while the critical target will require numerous resources with critical abilities that are accessible in a short period. If resources are not available with the required quantities, then the requisite target may not be achieved. Other than recognizing explicit resources for the demand zone, the estimated requirements for resources should respond to different inquiries:


In our simulation, we modeled the resource agent as an independent entity that responds and plans for appropriate resource allocation based on given selection criteria. Details of agent properties and behaviors are described in Table 1.

**Table 1.** Resource agent details.

#### **Resource Agent Properties**

	- a. Allocated *RAi*
	- b. Reserved *RRsi*
	- c. Destination demand *RDi*
	- d. Selection criteria for measures (severity, distance) *SCi*

#### **Resource Agent Behavior**

	- a. The resource agent selects demand on the basis of selection criteria
	- b. Sends confirmation and the reservation of available/required units of resources. Updates *RRsi, RDi,* and *R\_Rese*
	- a. The resource agent removes the resource unit from the Reservation list and add it to allocation *RRsi, RDi,* R*Ai,* and *R\_Rese, R\_Alloc*
	- b. Dispatches the resource to demand site.
	- c. On completion of demand's need (measures in time duration of allocation). The resources are taken from allocation list and are added back to pool by clearing *Rsi, RDi, RAi,* and *R\_Rese, R\_Alloc.*

Resource centers are capable of receiving demands from the disaster sites. Each resource center then bids to allocate the available units of resources to the demand site. Only on confirmation from the demand site the final allocation is performed. Once the resource's utility is completed at the demand site, the demand releases the allocated units and these units are added back to available pool. In the case where lack of available resources results in partial satisfaction of demand, in order to manage the complete demand, these new newly released units are then allocated to such sites.

#### *3.2. Demands*

Demand is considered as a disaster zone, a zone authoritatively announced to be the location of a crisis made by a disaster and subsequently qualified to get specific sorts of resources. There may be a hazardous situation is an area or a district, intensely harmed by common, innovative, or social perils. In our model, the demand agents, as described in Table 2, broadcast their requirement to all approachable resource agents. The resource agents then, depending upon their specific selection criteria, respond by reserving available units for the demand. This results in the demand site receiving multiple acknowledgments from multiple resource agents. The demand site then selects the nearest resource sites and confirms the reservations of that specific resource agent and declines the rest.

**Table 2.** Demand agent details.


Till the demands are met or demand expires:

	- a. Select the nearest resource agent and send the confirmation of allocation updates *D\_Alloc, DRsj*
	- b. Declines the rest of the reservations

The demand site then waits for resource units. At arrival of the units, the demand site retains the resource for the required duration. After completion of the task the resources are released back. In the case of partial allocation, the demand sites keep on broadcasting the remaining requirements to all resource centers until the demand is met or expires. In our model, the demand expiration depicts the situation where the demand's initial requested quantity is never met but the demand's requirements are met without these unallocated units. For example, for a certain incidence, initially 10 ambulances were requested, but only two vehicles were available at the time of request. The rest of the support is provided by self-help basis from citizens and injured are taken to medical facilities in other vehicles.

#### *3.3. Resource Allocation*

In general, RA is an arrangement for utilizing accessible resources to accomplish objectives. RA within the umbrella of ABM involves deployment of a large numbers of rescue services within an urban environment in the context of disaster. It is fundamental to emergency response planning. One of the challenges faced in emergency response planning is the optimal or near to optimal allocation of resources to specific emergencies. In the context of RA, the problem may be stated as resource R being allocated to demand D as shown in Figure 2a.

The RA process (Figure 2b) tracks which resource is held by what type of demand and which demand is waiting for specific kind of resource. Each cycle comprises of demand information and at least one allocation of demand.

**Figure 2.** General Resource Allocation Process (**a**) Overall Resource Allocation Cycle with release and reallocation (**b**).

#### *3.4. Allocation Algorithm*

The allocation algorithm defines RA selection criteria for utilizing accessible resources to achieve demand objectives. The allocation algorithm for the demand zone is a major DM activity that takes into consideration procedure execution.

In the allocation algorithm, the main focus is demand analysis that relies on a procedure by which RA decides on the creation, assignment, utility of resources, and estimation. How much a resource site produces resources depends on the capacity of creation that is based on the potential demand for the zone. Demand analysis is fundamental to conceivable linkage as well as in making an extension to basic RA. Demand analysis is vital to create satisfactory and efficient strategies for implementing the RA in a crisis or emergency situation. In our recent work, we used two selection algorithms, high severity level (HSL) and first come first serve (FCFS).

HSL is a technique for planning and utilizing resources that is dependent on severity of demand. In this technique, the demand zone utilizes the resource zone to fulfil its objectives according to their severity. In the severity algorithm, every demand is rigorous, but the demand with higher severity is allocated first, while demands of equal severity are allocated based on FCFS. Resources are progressively allocated in the demand zone when they are required. If the resources are not available, at that point the demand site within their time frame waits for the release of resources for utilization. The steps of HSL based RA are shown in Algorithm I.

#### **Algorithm I: HSL Algorithm**

*Given* Resource *Ri* with net units *Rn,* number of already allocated units *R\_Alloc,* and number of reserved units *R\_Rese* **and** Demand *Dj* with demand of units *Dm,* and severity level *D\_Sa.*


$$\min(\text{TraveellingDist}) \quad (\text{for } \mathbf{k} = 0, \dots \mathbf{x})$$

5. If resources are available reserve "*w*" Resource to Demand and update Reserved resources

$$w = \begin{cases} 0 & (R\_-\text{Res}^{(\text{old})} + R\_-\text{Alloc}) \ge R\_{\text{tot}}\\ (R\_-\text{Res}^{(\text{old})} + R\_-\text{Alloc}) - R\_{\text{ll}} & \text{otherwise} \end{cases}$$

*R*\_*Rese*(new) = *R*\_*Rese*(old) + *w*

6. If acknowledgement from demand site arrives for *t* reserved resources allocate resources to demand and update allocated and reserved resources

$$R\_{\text{\\_All}\text{oc}^{(\text{new})}} = R\_{\text{\\_All}\text{oc}^{(\text{old})}} + t$$

$$R\_{\text{\\_Res}\text{sc}^{(\text{new})}} = R\_{\text{\\_Res}\text{sc}^{(\text{old})}} - t$$

7. After time *D*t*\_totalj* the released z and are added back to available pool

$$R\\_All\alpha^{(\text{new})} = R\\_All\alpha^{(\text{old})} - z$$

8. end while

In the FCFS allocation algorithm, as the name suggests, the demand which appears first is granted the resources foremost. The demand site releases the resources after complete utilization of resources within its time frame. The steps of FCFS based RA are shown in Algorithm II. In the presented model demand location, number units needed by demands and allocation time are generated randomly Such random behavior is simulated using agents and the allocations are performed by individual policy of resource rather than system wide allocation. The conventional analytical models for RA perform optimization for entire system. In our work all resources and demands are independent agents lacking a centralized optimization authority.

#### **Algorithm II: FCFS Algorithm**

*Given* Resource *Ri* with net units *Rn,* number of already allocated units *R\_Alloc,* and number of reserved units *R\_Rese* **and** Demand *Dj* with demand of units *Dm* maximum time *Dt\_totalj*

1. Given broadcast of quantity *Dm* from Demand site D*<sup>j</sup>* is received by Resource R*i*.

Location of *ith* Resource is *Rxi, Ryi* Location of *jth* Demand is *Dxj, Dyj*


$$\begin{aligned} \upsilon &= \begin{cases} 0 & (R\_\text{-Res}^{(\text{old})} + R\_\text{-Alloc}) \ge R\_\text{W} \\ (R\_\text{-Res}^{(\text{old})} + R\_\text{-Alloc}) - R\_\text{ll} & otherwise \end{cases} \\\\ R\_\text{-Res}^{(\text{new})} &= R\_\text{-Res}^{(\text{old})} + \upsilon \end{aligned}$$

5. If acknowledgement from demand site arrives for *t* reserved resources allocate resources to demand and update allocated & reserved resources

$$R\_{\text{\\_All}}(\text{new}) = R\_{\text{\\_All}}(\text{old}) + t$$

$$R\_{\text{\\_Reset}}(\text{new}) = R\_{\text{\\_Reset}}(\text{old}) - t$$

6. After time *Dt\_totalj* the released z units are added back to availed pool

$$R\\_All\alpha^{(\text{noov})} = R\\_All\alpha^{(\text{old})} - z$$

7. end while

#### **4. Simulation and Results**

In our case, we used the NetLogo environment that is a good simulator of ABM with libraries to add GIS data. ABM captures emerging phenomena and provides a natural environment for the analysis of certain systems. It is a versatile technique especially in relation to geospatial model development.

#### *4.1. RA in GIS Space*

GIS is one of the most advanced technologies that have changed the manners in which RA has been used previously. These technologies have affected RA procedures explicit to the manner by which resources are utilized by the demand zone. In GIS space, it allows agents to be utilized as resources and demands into geospatial condition characterized by a GIS map. It includes a function to set and get the present agent space, allocate the resources to demands space according to RA procedure, to execute activity upon appearance, to execute the agent in its predefined environment, to set up interaction dependent on agents, design, and another attribute.

By using the proposed ABM in the previous section, we simulated a scenario for disaster in the Rawalpindi city in Pakistan. We took 65 union councils of Rawalpindi district. A disaster is created on a random building, which is our demand zone. It requires several resources to reduce the disaster effect in the zone. Figure 3 shows the steps that are involved in the creation of a scenario.

**Figure 3.** Steps for creation of scenario.

In Figure 4a, boundaries of the selected area are shown, and their total area is 122,982,339.2 m2. Whereas, Figure 4b shows road network of these selected areas. The roads network is created near to the resource station and building. We took four resource/rescue stations and 186 buildings for the scenario creation, which are shown in Figure 4c,d. A screenshot of the ArcGIS layer structure for NetLogo implementation is shown in Figure 5. Different experiments were simulated according to factors given in Table 3 in NetLogo environments.

**Figure 4.** Area boundaries (**a**), road networks (**b**), resources center (**c**), and digitalized building node (**d**).

**Figure 5.** A screenshot of the NetLogo environment for experiment 1 given in Table 3.


