A BIM-Based Solution for the Optimisation of Fire Safety Measures in the Building Design

A significant number of injuries and fatalities occur annually due to fire in buildings. The proactive use of fire safety measures at the design stage can potentially lead to a considerable improvement in reducing casualties by assisting occupants in a safe evacuation. In this study, a framework is developed to obtain a set of appropriate fire safety measures while considering their effects on safe evacuation (i.e., increasing the percentage of survived occupants) and budget limits. The framework consists of four phases, namely (1) initial preparation, (2) optimisation with a meta-heuristic algorithm, (3) decision making when the designer should select appropriate measures considering the budget limit, and (4) applying the selected measures into BIM. A binary version of Billiards-inspired Optimisation Algorithm (BOA) is developed and utilised in the optimisation phase. A case study approach is adopted for this research and the performance of the proposed framework is evaluated by implementing it in two case projects: a residential building and a hospital building. The results indicate that the framework is a beneficial approach for designers to modify building designs in terms of safe evacuation at the design stage by using fire safety measures effectively and economically. It is expected that the output of this framework will help decrease fatalities of building users during a fire.


Introduction
According to the latest statistics released on the scope of building fires, 2980 deaths and 13900 injuries were reported in 2019 in the US [1]. Although the rate of fatalities has decreased in recent years, building fires still lead to significant losses. This highlights the necessity of further considerations on fire safety engineering. The purpose of fire safety engineering is to reach optimised preventive and protective measures (i.e., the solutions that assist safe evacuation during fire are called measures) against fire to decrease fatalities and injuries by utilizing engineering concepts [2]. Using fire safety measures decreases fatalities by improving safe evacuation in the building. However, they may not be used efficiently. By modifying the designed model through applying fire safety measures proactively, costs are significantly reduced compared to changes in the construction and operation phases [3]. Due to diversity in costs and effects of fire safety measures, employing optimised measures are vital for stakeholders.
Selected evacuation paths of occupants vary depending on smoke propagation and the location of the compartment in which fire ignites [4]. There are some other factors affecting evacuation paths such as familiarity with the building and congestion [5]. However, this study mainly focuses on the hazard rather than on secondary effects. Each compartment depending on its usage has a value of fire start probability [6]. To reach a set of optimised fire safety measures accurately, it is necessary to consider every compartment of the building as a probable fire source in the optimisation phase. In this study, fire scenarios are defined according to the positions of the fire source (i.e., each compartment) in the building.
The goal of this paper is to develop a framework to reach an appropriate set of optimised fire safety measures in optimal positions considering all fire scenarios at the design stage. Evaluating the effects of fire safety measures on safe evacuation requires an interoperable environment. Such an environment should consider positions of fire safety measures and it should model occupants' evacuation and smoke propagation for every fire scenario simultaneously. Furthermore, implementing the proposed framework requires an environment capable of storing and utilising information on the compartment's features (e.g., area, usage, population density, and accessibility to other compartments). Previous studies have used Building Information Model (BIM) as an interoperable environment for fire safety management applications [7] including, identifying unsafe paths [8] and effective factors [9] in evacuation simulation during the fire. BIM has promising features such as information storage, which allows extracting, storing, and utilizing design information to perform the required computations of the proposed framework (i.e., evacuation and smoke propagation modelling in the building design and implementing optimisation of fire safety measures) [7,10]. Thus, BIM can be used as an environment to execute the proposed framework.
Some researchers investigated the issue of occupants' safe evacuation and consequently obtained solutions to decrease fatalities, which is discussed in the literature review. However, none of the previous studies have implemented optimisation techniques in selecting appropriate fire safety measures with their corresponding positions in the building design considering all of fire scenarios in an acceptable time. The research reported in this paper aims to present a BIM-based framework to obtain a set of optimised fire safety measures regarding efficiency and budget limit that enhances the safety of occupants. The proposed framework optimises fire safety measures by incorporating safe evacuation for all fire scenarios. Because of this, a Revit plugin is developed to enable the implementation of the proposed framework. Many optimisation algorithms exist, in particular meta-heuristics such as GA [11], PSO [12], and BOA [13] that can be used in the proposed framework. In this study, Billiards-inspired Optimisation Algorithm (BOA) is customized according to the nature of the identified problem, and is called the Binary Billiards-inspired Optimisation Algorithm (BBOA). It is adopted to optimise the combination and the positions of the defined fire safety measures. BBOA results are compared and validated with GA and PSO. The results indicated that BBOA performance is comparable to other meta-heuristics including GA and PSO. The selected optimised set of fire safety measures are applied in the BIM model to increase the number of survived occupants in building fire incidents. This framework facilitates the decision-making of stakeholders regarding budget limitations and achieving maximum efficiency. Furthermore, in this paper some factors such as the large number of compartments in a building as a starting point for fire ignition, and various measures with different characteristics are considered to enhance the performance of the framework.
The rest of the study is organized as follows: In Section 2, a review is conducted on concepts and the recent research on BIM, fire safety scope, and optimisation algorithms. In Section 3, the methodology and the proposed framework is explained. The proposed framework is examined through two case studies, and the results are shown and discussed in Section 4. Ultimately, the conclusion is presented in Section 5.

Evacuation
Safe evacuation is essential to cut down on the number of fatalities and injuries during a fire hazard. Many factors influence safe evacuation in the building such as attributes of the occupant's behaviour, acquaintance with building paths, life-threatening conditions created by fire, and building features [14][15][16]. Sustainability has different dimensions and aspects that are noticed by many researchers. One of the aspects of sustainability is concerned with human-based actions [17]. More specifically, this dimension of sustainability is concerned with actions that improve vulnerability of population versus disasters, such as evacuation in emergencies [18,19].
Two major types of evacuation approaches are available, namely microscopic and macroscopic modelling [20]. In the former approach, occupants' evacuation and their characteristics (e.g., physic, behaviour types, gender) are examined individually in occupants' evacuation modelling [20]. In the macroscopic approach, occupants' evacuation and characteristics are examined in a group manner and occupants of any compartment in the building are considered as a group of people with an average velocity and a constant density [20,21].
There have been many studies on microscopic and macroscopic evacuation modelling using corresponding different models. Wang et al. [22] developed microscopic modelling employing a social force model for occupants' evacuation in buildings during fire conditions in the Unity environment. Song et al. [23] studied evacuees' behaviour during evacuation through microscopic evacuation using cellular automata and the A* algorithm for path planning. Shi et al. [4] proposed microscopic modelling via agent-based modelling to simulate evacuation during fire. To demonstrate the application of macroscopic modelling for evacuation, Schomborg et al. [24] proposed a macroscopic network model to understand pedestrian evacuation in an emergency condition. They concluded that macroscopic modelling requires less computation time than microsimulation, however, less detailed information about evacuation is provided by this model [24]. In another study carried out by Ndiaye et al. [25], macroscopic modelling was utilised to model evacuation during critical situations using a network flow model to decrease evacuation time as well as increase the safety of occupants. Ndiaye et al. [26] used a network flow model for evacuation during emergency conditions to increase the number of survivors in a determined time for evacuees [26]. Macroscopic flow models use a dynamic network consisting of nodes and edges [25]. In every node, a group of occupants are considered with specific density and velocity, which travel from one node to another node [25]. Evacuation time for travelling between nodes considers distances between nodes, assigned to the connective edges [25]. When it comes to calculating the evacuation time, modelled evacuation time in SFPE Handbook is utilized [27]. Modelled evacuation time employs hydraulic estimation of occupants' flow for computations [27]. The velocity and density of a group of occupants accommodated in each node are determined through the modelled evacuation time relations. Then the required safe evacuation time is calculated. Its related equations are presented in Table 1. In these equations, it is assumed that all occupants start evacuation simultaneously from the centre of the room, movement flow of occupants does not include any discontinuity due to personal decisions [27]. No disabilities have been considered and all occupants are assumed to be moving at a similar pace [27]. There is some software for evacuation simulation such as EvacSim [28], EVACNET [29], Social Distances [30], Pathfinder [31], Exodus [32] that are time-consuming [33,34]. These software packages are computationally expensive, which will be discussed in detail in Section They are not opensource, which means it is required to set subjective parameters manually for every simulation in these software packages [33,34]. Implementing optimisation requires several iterations, and every iteration needs to set subjective parameters manually (e.g., distribution of occupants' density and model preparation). Some of the mentioned software packages are unable to import BIM [28][29][30], thus, the design must be modelled within the software, which is time-consuming. On the other hand, optimisation of fire safety measures requires considering smoke propagation modelling in addition to evacuation that is not possible for most of the mentioned software [33,34]. Therefore, it is concluded that these software packages are unsuitable for the optimisation of fire safety measures. Overall, a survey of the literature revealed that microscopic modelling has more accuracy while it requires more computation time in comparison to macroscopic modelling [16,21,24], and as a result, macroscopic evacuation modelling has more compatibility with the aim of this research.

Smoke Propagation
Smoke propagation, which is quicker than the fire spread, is identified as the primary life threat for occupants in the case of building fires [35,36]. The influence of smoke propagation on occupants' evacuation depends on smoke characteristics and how it propagates [36,37]. Under fire conditions, occupants may require moving through paths in which smoke propagates in the building. According to [37], smoke can cause serious injuries to the evacuees if the smoke temperature exceeds 200°C [37,38]. Two main approaches exist to investigate how smoke propagates, including zone modelling and field modelling [38]. Some researchers have studied the process of smoke propagation using these two approaches (i.e., zone modelling and field modelling). Nishino [39] presented a model to calculate smoke propagation using zone modelling that takes into account horizontal smoke propagation under the roof. In the zone modelling, it is assumed that there are two distinct layers for space: a hot smoke layer and an air layer. Characteristics of smoke (e.g., temperature and density of particles) are considered to be uniform throughout each layer [35]. One of the methods to analyse the smoke movement is algebraic equations [36], which is based on zone modelling. Algebraic equations consider the bottom of the smoke stratum to stay at a predetermined height [36]. In Table 2, the computational equations for algebraic equations are presented according to [36].  = is atmospheric pressure (Pa) R is gas constant (287) T is smoke's absolute temperature (°K) When using field modelling, a space is partitioned into numerous cells, and for each cell, computations for smoke characteristics are executed [38,40] developed a hybrid model for smoke propagation that utilises field modelling for fire ignition spaces and zone modelling for other spaces and passages. On the other hand, commercial software packages are available for modelling smoke propagation using field [41] or zone modelling [42]. For example, the FDS software uses field modelling for simulating smoke propagation [43]. Using field modelling software requires a considerable amount of computation time for each simulation, which is one of the main challenges in optimisation approaches. Furthermore, there are some software packages based on zone modelling such as CFAST [42,44]. They have some drawbacks that limit their applicability in some situations, their inability to import BIM and limitations in the number and shapes of rooms of buildings [44]. The review of the literature shows that zone modelling and field modelling have some advantages and disadvantages. Zone modelling has a lower computation time than field modelling while it has lower accuracy. Nevertheless, a simplified and compatible smoke propagation modelling method that is based on zone modelling should be utilised for the optimisation approach, that is developed in the proposed framework in this paper.

Fire Safety Measures
Several solutions exist for safe evacuation during the fire, known as measures [2,38]. Sprinklers, emergency exits, self-closing fire doors, pressurized stairwells, smoke evacuators, and smoke detection systems are samples of fire safety measures that can affect safe evacuation through increasing available safe evacuation time and decreasing required safe evacuation time [2,38]. Sprinklers affect fire growth for the benefit of safe evacuation [38]. They diminish the heat release rate and, consequently, overall smoke generation, which increases available safe time for evacuation [45]. The equation used to calculate the heat release rate after sprinkler activation is presented as follows [46]: where, ̇ is heat release rate (kW), is the time after activation of sprinklers (s), ̇″ is spray density (mm/s), is the time of sprinkler activation. Emergency exits are used to increase the number of escape routes, decreasing the required safe time for evacuation [2,38]. Self-closing fire doors control smoke spread by means of restricting smoke movement between rooms, increasing available safe time for evacuation [47]. Pressurized stairwells, smoke evacuators, and smoke detection systems can assist safe evacuation via controlling the smoke spread and providing more available time for occupants to evacuate [2,38].
Several researchers have investigated the impact of fire safety measures on safe evacuation. For example, studies have focused on utilizing sprinklers in buildings, examined its effects on induced life-threatening conditions by fire such as temperature [48] and propagation of smoke [35,45]. Other studies explore the role of locations of emergency exit signs in buildings [49], and utilization of self-closing fire doors [50] on safe evacuation. These studies have demonstrated that fire safety measures have a substantial role in improving safe evacuation.

Application of BIM and Graph Theory in Fire Safety
BIM is a process in which all building elements are modelled as 3D object-oriented elements with corresponding information for all stages of the life cycle of the building [10]. BIM has promising features for fire safety, e.g., determining paths and identifying unsafe paths for evacuation at design, operation, and maintenance phases [7], analysing the impact of gaps caused by dimensional and geometric variations on the smoke propagation [51,52]. Sun and Turkan [8] examines occupants' evacuation during the fire for the purpose of safe paths for occupants and determining unsafe zones in the building design. They propose BIM, agent-based modelling and FDS software integrated into a simulation. Abolghasemzadeh [16] investigates the occupant's behaviour confronting dynamic conditions of evacuation during the fire and proposes a microscopic simulation through integrating BIM and agent-based modelling. To inspect influential factors on evacuation, BIM and agent-based modelling are integrated by Bina and Moghadas [9]. In their study, determinants such as occupants' behaviours, gender, and location of the exit door in the design were examined.
A graph model consists of nodes and edges. In such a model, edges represent the connection between nodes [53]. To check accessibility between compartments in the building design, the graph model can be used as an applicable tool. The defined compartments are represented as nodes, and edges show accessibility between them in the graph model [54]. Utilizing the graph model and its potential features in pathfinding helps BIM to perform more efficiently [54]. A graph model can be extracted from the BIM, in which nodes and edges represent the defined compartments and portals, respectively [54]. Extracted graph models can be helpful for pathfinding between compartments in the BIM [54]. Hence, it could be utilized in evacuation modelling. Graph theory is individually used in the macroscopic flow network model for occupant evacuation modelling by Schomborg et al. [24] and Ndiaye et al. [26]. As a result, many studies employ the potentials of the graph theory approach in fire safety. Zhi et al. [55] converted 2D CAD drawings to a graph model and used them as an input for evacuation modelling. Desmet and Gelenbe [56] use the capabilities of graph theory to detect positions of critical places in a building during an emergency evacuation. A review of the literature reveals that extracting graph models from BIM is examined in many studies through various methods for different purposes. The main objectives of these studies concentrate on the performance of exit signs [57] and route-finding purposes [54,58].
The architecture, engineering and construction (AEC) industry is not deprived of the use of meta-heuristics. Meta-heuristics have been widely used in the design of structures [65], optimisation of construction site layout [66], material selection [67] and project scheduling [68]. Additionally, several studies have been conducted in the field of occupants' safe evacuation. For instance, Gao et al. [69] implement an optimisation using branch and bound algorithm to reach the optimised location of doors and consequently reduce evacuation time. A genetic algorithm is used to reduce evacuation time for buildings optimisation with regards to the level of service [70]. Liu et al. [71] applied Quantum Ant Colony Algorithm (QACA) to optimize evacuation paths to decrease required evacuation time. Nevertheless, as far as it is known, in the existing literature, optimisation is carried out without thoroughly considering all of the fire scenarios in a building.

Binary Billiards-Inspired Optimization Algorithm (BBOA)
The major purpose of Billiards-inspired Optimisation Algorithm (BOA) is inspired by the game of billiards. Billiards is a game with a rich physical background and one of its highlights is the collision between the balls. In perfectly elastic collisions, the kinetic energies of balls are conserved before and after collisions, besides the sum of both momenta. In this situation, the balls switch only the component of their velocities, which is parallel to the impact line [13]. Figure 1 illustrates velocity components of billiards balls after the collision that is inspiring for BOA. Note that the symbols ∥ and ⊥ denote parallel and perpendicular components of velocities according to the impact direction, respectively. There are some vectors in Figure 1, which are defined as follows. ����⃑ is the velocity of the cue ball before its collision with the object ball. ����������⃗ is the velocity of the cue ball after its collision, which is perpendicular to the impact line. ����������⃗ is the velocity of the object ball after its collision, which is parallel to the impact line.
Further information regarding BOA can be found in [13]. In [13], BOA is validated by mathematical benchmarks and common engineering problems. The results of this study show prominent results in comparison with other meta-heuristics. In the research reported in this paper, the BOA algorithm is adopted because it is convenient to use, and it is compatible with the problem that is tackled in this research.

Proposed BIM-Based Framework Mechanism and Developed Plugin
For the purpose of the BIM-based framework, an Autodesk Revit plugin is developed using the C# programming language. Figure 2 presents an overview of the proposed framework. A case study is adopted for addressing the research aim. This method is selected when explaining, describing and exploring a contemporary phenomenon within a real-world context and when the research study answers "how" questions [72]. The case study in this research aims to answer how to optimise types and positions of fire safety measures in the building design regarding budget limit and their effects on the percentage of survived occupants. The real-life setting is an essential part of the case study, in which many variables may affect the outcome [73].
The following steps have been undertaken together with a case study to address the gap in the current state of knowledge for the fire safety measures' optimisation: • The initial framework and BIM plugin was developed based on a synthesis of the findings from the literature review.

•
The binary version of the Billiards-inspired Optimisation Algorithm (BOA) is developed and utilised in the optimisation phase of the proposed framework.

•
The proposed method was implemented and validated in an explorative case study in two projects. The findings from the implementation of this framework can be found in the Case Study section.

•
The proposed framework is implemented in two case projects. The lead time sensitivity analysis is carried out to determine the appropriate lead time for each case project. Moreover, the effectiveness of the proposed approach was evaluated based on increasing the percentage of survived occupants using optimised fire safety measures effectively and economically in two case projects.

Phases List
A comprehensive description of the phases of the proposed framework is elaborated on next. The framework mainly consists of four phases, namely initial preparation, optimisation, decision making, and finalisation. Figure 3 presents details of the proposed framework. The proposed framework will be implemented in two case studies. Also, the model will be validated in Section 4.2.  Figure 4 shows the user interface of the plugin, which is presented for the first time in this paper. The plugin interface is developed on the Revit software using the C# programming language. The plugin interface can be executed from the add-in's toolbar. Then, three options are demonstrated to select. At first, the properties button is selected to set subjective parameters for optimisation such as budget limit, second, the fire safety optimisation button is selected to run the plugin, third, the resulting form appears to view the results of optimisation.

Manual and Automatically Calculated Inputs
The required inputs in this approach include BIM of the project, usage of each compartment, cost of each measure, compartments with the potential of having emergency exit, and budget limitation. Based on the designer inputs, the fire start probability and number of occupants for each compartment are automatically calculated. To calculate the fire start probability for each compartment, the following formula is used [6,74,75]: where, is fire start probability, and are constants that depend on the type of occupancy, and is the floor area ( 2 ) of a compartment. The K and factors are determined according to [74,75]. The number of occupants in each compartment can be determined through predefined occupant densities [38,76]. The initial inputs for the proposed framework, including budget limit and fire safety measures, are collated in the properties form of the developed plugin depicted in Figure 5. Characteristics of BIM including type, area, usage, fire ignition probability and the number of occupants are also demonstrated in the properties form. The presented fire ignition probabilities are relative. Graph Extraction from BIM Using graph theory facilitates the function of pathfinding in a macroscopic network flow model for evaluating safe evacuation. Therefore, in this study, a graph model is automatically extracted from BIM using Application Programming Interface (API) programming which is developed by the authors to take advantage of graph theory in pathfinding. To increase the accuracy of computations, large compartments can be separated into smaller ones hypothetically using an Autodesk Revit feature called "room separator". The "Room separator" feature is used to detect convex rooms by the plugin. The compartments are linked to each other via passages (i.e., door, stair, and room separator). Each compartment or passage is considered as a node in the graph that occupants have to pass toward the exits.
The developed Revit plugin automatically receives the required information of the compartments and passages (e.g., area, width, and accessibility) using API and creates the 3D graph from the model. The centre point location of each compartment or passage is obtained and a node is added to the building graph. The compartments or passages that are linked to each other in the building plan are connected using edges in the building graph. Moreover, the required characteristics of compartments (e.g., area, volume, number of occupants, and fire start probability) and passages (e.g., width) are assigned to the graph nodes. Figure 6 illustrates the process of graph extraction from BIM by the developed plugin. Figure 6. Process of graph extraction from BIM by the developed plugin.

Optimization Phase
This phase concentrates on the process of implementing an optimisation algorithm to obtain an optimised position and a combination of fire safety measures. These implementations yield different costs and have varying impacts on safe evacuation.

Optimization Mechanism
In this research, the Binary version of the BOA (BBOA) is introduced for the problems with true or false nature. In this scenario, some changes are added along with some simplifications. Simplifying the algorithms makes them easier to understand and implement, and also reduces errors. It is noticeable that the proposed framework is capable of employing some other meta-heuristics such as GA and PSO. Equations (2)-(6) are for BBOA. BBOA is a simplified and customized form of BOA for the optimisation problem in the proposed framework. Equations (2)-(6) are simplified in comparison with BOA and are inspired by the algebraic summation of velocities.
In the BBOA algorithm, each potential solution is considered a multi-dimensional billiards ball. These balls are the agents of the optimisation process and each dimension of them is representative of a variable. Contrary to the continuous BOA [13], the BBOA search space is restricted as S = [0, 1] M (M is the number of variables) and the position of each ball denotes the probability of adopting true value. The optimisation process starts with 2N number of random balls (i.e., population size) in the search space with the value of [0-1] range. Additionally, some balls are generated as pockets that the exploitation ability of the algorithm is provided by them. For each object ball, the target pocket is specified by utilizing the roulette-wheel selection mechanism. So, the valuable pockets have higher chances of selecting. The new positions of object balls after the collision are calculated as: where, . and , are the new and the old values of the ℎ variable from the ℎ object ball, respectively. The , is the ℎ variable of the ℎ pocket which belongs to the ℎ object ball. is the error rate that gradually decreases along the searching process.
In this version, unlike the original BOA, velocities are determined according to distances, not the kinematic calculations. The velocities of the object balls after the collision are defined as follows: where, ���������⃗ is the velocity of the n th object ball after the collision; is the ℎ pocket which belongs to the ℎ object ball and is the old positions of ℎ object ball. The velocities of cue balls before the collision, + ���������⃗, are determined as follows: where, + is the position of the n th cue ball before the strike. Based on vector algebra, velocities of cue balls after the collision are calculated as: The updated positions of cue balls according to their velocities are calculated as follows: Parameter decreases along the searching process and limits the movement of cue balls. To map the updated positions (i.e., probabilities) in binary concept and produce updated shadows, = [ ,1 , ,2 , ,3 , … , , ], which is a random vector with a uniform distribution in an interval of [0, 1], is generated for all balls. If . < , , corresponded dimension in shadow adopts 1, otherwise 0.
After the updating step, pockets as the best solutions will then be updated and the process will be repeated several times. The searching process will be terminated after reaching a specific criterion such as a fixed number of iterations. The best pocket will be delivered as the output of optimisation. The BBOA pseudo code is shown in Figure 7. By identifying usable locations for fire safety measures, the variables of the optimisation process are determined. The structure of balls as optimisation agents is illustrated in Figure 8. Each ball is divided into three parts, in which, each one is relevant to one type of the three considered measures (i.e., sprinkler, self-closing fire door, and emergency exit). Every part consists of some slices as variables of optimisation or in other words, the dimensions of search space, and the number of slices for each part equals the number of compartments, doors, and possible locations for emergency exit, respectively. The value of each slice indicates the probability of that measure's location for selection, and in the shadow ball, the final status of employment of measures are shown. For instance, if a compartment has a sprinkler, its relevant slice value for the sprinkler is set to true in the shadow ball.  In the optimisation phase, the modified percentage of survived occupants is considered as the fitness value. The BBOA process tries to find better balls with higher fitness values during many iterations. Termination criteria for the optimisation mechanism is suggested to be no improvements in the percentage of safely evacuated occupants. The percentage of safely evacuated occupants in each scenario is determined using Equation (8).
where ( ) is the percentage of safely evacuated occupants in scenario , is the number of all occupants, and ( )is the number of injured occupants in scenario . To calculate the modified fitness value for all of the fire scenarios due to their fire ignition probabilities, Equation (9) is utilised: where ( )is the percentage of safely evacuated occupants in scenario , ( ) is the probability of fire ignition in scenario that is calculated in the first phase, and is the number of scenarios.

Evaluation of Occupants' Safe Evacuation Considering Smoke Propagation
When a fire scenario in a building occurs, occupants' safe evacuation depends on whether propagation of critical smoke conditions blocks their paths to the exit or not [47]. The proposed framework utilises a macroscopic network flow model that is a graph-based approach for evacuation that has less computation time in comparison with other approaches and software. This function is discussed in the ensuing sections in more detail. The developed function makes the performing optimisation to be logical and applicable. Computational equations for evacuation modelling are presented in Table 1. In the proposed macroscopic network flow model, occupants in each compartment (corresponding node) are considered as a group of occupants with the same velocity that is calculated according to equations in Table 1. By proceeding with every lead time, computations are updated in the network model and duration for movement and queuing are calculated according to Table 1. Simultaneously, smoke propagation proceeds in every lead time and it blocks the path of occupants in the graph model. In Figure 9, The process of evaluation of occupants' safe evacuation is shown. Occupants can find the shortest path to exit by different means, such as being familiar with the building [77], being guided by another occupant [78], using real-time guidance systems, [79] and exit signs [80] in a complex public building (e.g., hospitals and commercial buildings). Currently, regulations and codes in many countries enforce designers to employ exit signs or other guidance systems in complex public buildings. Using these systems helps occupants find the shortest path to the exits particularly in complex public buildings. In this paper, it is assumed that exit sign systems are utilised in complex public buildings and occupants are familiar with the building and know the shortest path to the exits. It is possible to incorporate different knowledge states for occupants in this framework, however, occupants are often not aware of the fire ignition location and smoke propagation conditions. To provide the shortest path to the exit in the building graph, the discrete environment A* algorithm is suggested due to its efficiency and compatibility with the proposed framework. This algorithm utilises a heuristic function to progress in the goal's direction which reduces the path finding time [81,82].
Movement of smoke with critical conditions according to SFPE [37] is modelled to evaluate whether critical smoke conditions block paths of occupants. For smoke propagation, zone modelling is perceived to be more compatible for the purpose of this research. It is then examined whether the flow of smoke with a temperature of 200°C at the height of 2 m (which is regarded as a smoke critical condition) blocks paths of occupants. This is carried out based on algebraic equations, [36][37][38].
The required time for occupants to reach each node in the graph and time of smoke arrival with the critical conditions at each node can be calculated using equations in Tables  1 and 2. Occupant evacuation and smoke propagation are computed at each lead time.

Decision Making Phase
Delivering a Pareto chart that illustrates the variation of the percentage of survival against the cost of employing fire safety measures can provide an insightful decision-making tool for the designer to select the preferred optimised option. The output of the plugin illustrates this chart ( Figure 10). The designer can select the preferred optimised combination and position of fire safety measures from the plugin, which is highlighted with a bold point. Every bold point in Figure 10

Finalization Phase
An automatic Revit implementation assistant tool is considered in the plugin to help the designer in applying the selected solution in BIM at the design stage. When a budget limit solution is selected, the "Implement in Revit" button in Figure 10 automatically sets the measures in their positions in BIM. It replaces the final optimised combination of fire safety measures in the building design by placing sprinkler heads, changing the usual doors into doors from an imported self-closing fire door family, and specifying the compartments in which an appropriate emergency exit way should be provided. Note that the design of the sprinkler is complex, and the designer should complete it.

Assumptions Made in the Proposed Framework
It is required to make appropriate and rational assumptions in this research when developing the framework. The assumptions are:

•
Process of occupants' evacuation and smoke propagation are updated at each lead time, which is considered 0.5 s and 1.5 s for the hospital building and the residential building respectively. • When occupants try to pass an entrance or passage that is not wide enough, they are stuck in queues and the required time for each occupant to pass a queue depends on the entrance or passage width and the density of occupants in there, which is considered in computations via equations in Table 1.
• All the doors are assumed to be open at the time of fire ignition and smoke can propagate between compartments. This assumption is particularly similar to the assumption of software packages such as CFAST.

•
Each room is considered blocked whenever the space between its ceiling and height of 2 m from the floor is engulfed by smoke with a temperature of 200 °C ; as this condition is considered harmful for occupants [37,38,83].

•
Costs of fire safety measures are presented in Table 3 according to the market: • The occupants' pre-movement time is also available for the designer to determine and it is estimated as 100 s by default, based on the Fire Engineering Design Guide book [38]. Pre-movement time is the duration before the occupant starts to move [27,38]. • Population sizes of residential and hospital buildings for optimisation are considered 32 and 64, respectively.

Case Study
The architectural Revit models of the case studies, which are required for the implementation, are provided by the designer. One of the case studies is a residential building and the other one is a hospital. Although a residential building is relatively simple in respect to the evacuation paths and the exits number/position, it is selected mainly for smoke propagation and evacuation modelling validation. As mentioned in Section 2.2, zone modelling software packages for smoke propagation are only able to model rooms with simple shapes (i.e., square and rectangular). The hospital building is selected as it is more complex, and it can indicate the applicability of the proposed framework. The residential building has three stories, with a floor area of 170 square meters for each story. It is located in the city of Tehran in Iran. The building's main exit is located on the ground floor. Figure 11 illustrates the sample plan of the building which is similar to other stories. To separate large compartments without a wall and to increase accuracy, the room separator feature of Revit is used, and its results are depicted with dash lines. Regarding the building plan, two emergency exits are assumed: one in story 2 and the other one in story 3. Also, the 3D view of the model of the residential building is shown in Figure 12.  The hospital building has two stories, with a floor area of 841 and 685 square meters for stories 1 and 2, respectively. It is located in the city of Tehran in Iran. The building has two main exits located on the ground floor. The ground floor is connected to the upper floor with two staircases. Figure 13 illustrates the plan of the hospital building's stories. Similar to the previous case study, dash lines represent the room separator feature. Regarding the building plan, one emergency exit is also assumed on the second floor. The 3D model of the hospital building is shown in Figure 14. The extracted 3D graph of the residential building and the hospital building are shown in Figures 15 and 16. As shown, floors are connected through stairways, which are depicted with dash lines.
Fire can be started from each of the defined compartments with the respective fire start probability. Therefore, fire ignition in each compartment defines a fire scenario. In this paper, all of the fire scenarios with their corresponding fire start probability are considered in optimisation (i.e., number of fire scenarios equal to the number of compartments).

Lead Time Sensitivity Analysis
Determining an appropriate lead time for the two modules, smoke propagation and occupants' evacuation, is important for the simulation. Regardless of the improved accuracy, if the lead time is too short, the simulation requires more computation time and vice versa. To determine a proper lead time, an examination is conducted. In this examination, results of the two modules are collected with lead time durations varying from 0.01 to 5 s incremented by 0.01 s. For instance, the obtained duration of the evacuation process/smoke filling time will have maximum accuracy, if the lead time is considered 0.01 s. Then, by increasing the lead time, accuracy and the duration of the calculations are decreased. The results of these two modules are the obtained duration of the evacuation process/smoke filling time in the respective lead times. In the smoke propagation module, a predefined room is selected as the fire ignition room. Figure 17 represents the percentage of variations in the modules' results of the case projects versus the lead times. The horizontal axis is the used lead time which varies from 0.01 to 5 s. The vertical axis indicates the percentage of variations in the obtained duration of the evacuation process/smoke filling time from the modules. From Figure 17, it is observed that the smoke propagation module is less sensitive to lead time changes against the evacuation module. In the residential building, for the lead times longer than 1.5 s, the evacuation module's results increase steeply. Therefore, a lead time of 1.5 s is chosen for the residential building. Similar to the residential building, 0.5 s is obtained as the proper lead time for the hospital building.

Validation
A complete validation of the proposed framework requires real field experiments. However, such validations are not feasible as they include serious safety concerns. There are studies in which real-world experiments on smoke propagation have been conducted. Such real-world experiments include smoke propagation using hydropower stations [87] and ventilated tunnels [88]. Real-world experiments provide more accurate outcomes, however, it is widely known that such studies are not economic, especially for situations that require numerous iterations (e.g., for optimization) [89]. Furthermore, as far as the authors are concerned, no study exists that deploys real-world experiments to implement simulations for evaluating safe evacuation, which is the main concern in this research.
Alternatively, the two modules' results are compared with other well-known software packages to validate the performance of the developed system. The software packages that are used for evacuation and smoke propagation validation are Pathfinder [31] and CFAST [44] respectively. These two software packages were validated and used in past research [90][91][92][93]. Thus, they can be used for validation in this study. In the proposed framework, a large number of fire scenarios are simulated due to the requirement of the optimisation phase. A sample scenario for the first case project of this paper is defined. The scenario is for each of the two modules and the results are compared with other applicable software. On the other hand, the validation of the hospital building case project is deemed to be not feasible due to the limitations of the zone modelling smoke software in the number and shape of rooms. Therefore, the residential building is considered to validate the results.
For the residential building case project, each of the 30 compartments can be considered as the fire ignition location that makes a new scenario. Each scenario requires about 100 iterations to reach optimum results, and each iteration evaluates 32 agents. Assuming six budget limits that are considered by the designer, the total number of evacuation or smoke propagation simulation calculations is equal to 576,000.

Evacuation Validation
The evacuation simulation is conducted using the Pathfinder software for the considered number of occupants in the residential building [31]. The computation time of the Pathfinder to accomplish the calculations of one evacuation scenario is about 70 s. Considering 576,000 evacuation simulation calculations, it takes about 11,200 h for the residential building evacuation simulation to be completed by the Pathfinder software. This emphasises the necessity of developing a fast macroscopic evacuation modelling that is compatible with the proposed framework. It appeared that the developed method in this study only needs 1.6 h a complete optimisation of the residential building case project with six budget limits. Figure 18 presents the comparison between the results of the Pathfinder software and the developed evacuation module for each story of the residential building case project. As illustrated in Figure 18, the developed evacuation module's results are up to 13% less than the Pathfinder software results. Other researchers [94,95] observed that manual calculations results are up to 32% less than Pathfinder results. Hence, the proposed module has more accuracy in comparison with Pathfinder and its performance is acceptable.

Smoke Propagation Validation
Software that uses field modelling like FDS [43] requires a considerable amount of time for simulation of smoke propagation. For the residential case projects, it takes about 4883 s for one simulation to be accomplished. Assuming 576,000 smoke simulations, it takes about 781,280 h for the residential building smoke simulation to be completed by the FDS software. The total required time for complete optimisation of the residential building case project using the developed method is about 1.6 h, as indicated earlier. The CFAST software [44], which is based on zone modelling, is faster than FDS. However, the identified limitations during the review of literature necessitate developing a compatible smoke propagation module for the proposed framework.
The CFAST software is selected for the validation of the results of the smoke propagation module. Figure 19 shows the results of the comparison for each story. It is assumed that the fire ignites from the kitchen on the third floor. The smoke filling duration of the stories is considered in the comparison. As illustrated in Figure 19, the developed smoke propagation module's results were obtained between 15-30% less than the CFAST software results. [96] observed that manual calculations results are up to 40% less than the CFAST results. In other words, the proposed method has more accuracy in comparison with the available commercial software and its performance is acceptable. In other words, this was to validate outputs of BBOA with well-known algorithms such as GA and PSO. The presented Pareto fronts reveal that this algorithm has produced competitive and better results than the other two algorithms.

Results of Applying the Framework to the Case Studies
Results of implementing the developed method in the two case projects are presented in this section.

Optimisation Results of Case Projects
Optimisation results of the proposed framework for residential and hospital buildings are demonstrated in Figures 22 and 23, respectively.
Optimisation of fire safety measures could be carried out for more budget limits while this study considers a number of specific budget limits. Obtained optimised sets of fire safety measures do not necessarily use all of each budget limit. Therefore, the actual cost of every set of fire safety measures may be lower than the budget limit. Actual costs, percentage of survivors and utilized fire safety measures are presented for residential and hospital buildings in Tables 4 and 5, respectively.    The cost of €600 increased the percentage of survival from 27.9% to 63.57% in the residential building. Figure 24 illustrates the optimised combination and position of the measures with €600 budget limit in the residential building.

Comparison of Individual Measures
In this section, individual measures are compared with each other in terms of cost and efficiency. Each measure is independently optimised for various budget limits. Figure  25 demonstrates the results of these optimisations.

Discussion
Optimisation of fire safety measures is carried out for several budget limits, and their results are demonstrated through connecting optimised results (i.e., fitness value versus cost for each optimised set of fire safety measures). As a result, designers can realise the variations of fitness value for an optimised set of fire safety measures against costs. This function helps designers choose the most appropriate solution. The proposed framework and the developed plugin can increase the number of budget limits to increase continuity between solutions and they can provide designers a higher number of solutions and more accurate charts.
Key findings of the results of the proposed framework are provided as follows: • In this study, BOA was customized for the optimisation problem and called BBOA. Its results were compared with well-known meta-heuristics including GA and PSO in Figures 20 and 21. The comparison proved the validity of the BBOA.

•
According to Tables 4 and 5, without utilizing any fire safety measures, only 27.9% and 52.65% of occupants were able to evacuate from the residential and hospital buildings, respectively. Given the characteristics of the hospital building (e.g., two stairways, two main exits), the percentage of survival for the hospital building is more in comparison with the residential building. In the residential building, the only exit route of the building was quickly filled with smoke prohibiting occupants from evacuating the building. This finding emphasizes the number of main exits and generally exit paths outside of the building, which must be considered in complex public buildings.

•
As can be seen in Figure 24, at the cost of €600, only self-closing fire doors are feasible. The optimised position of the self-closing fire doors prohibits the spread of smoke from each floor to the stairway (the evacuation route of the building). This can substantially increase the chance of occupants evacuating the building safely. Thus, this indicates the importance of using self-closing fire doors in the entrance of the main exit paths. This provides a safe exit path for occupants and consequently more available evacuation time.

Residential-No Measure
Hospital-No Measure Residential-Self-Closing Fire door Hospital-Self-Closing Fire Door Residential-Emergency Exit Hospital-Emergency Exit Residential-Sprinkler Hospital-Sprinkler • According to the budget limits, the proposed framework indicates that the initial rising trend in both cases plateaus for costs higher than €10,000. In other words, a 19% increase in the percentage of survival requires up to an 81% rise in expenditure (demonstrated in Figures 22 and 23.). This shows that spending about €10,000 for fire safety measures with their optimal positions in these buildings seems acceptable and economic.

•
Until the cost limit surpasses €70,000, which is the infrastructure cost of sprinklers, no change in the percentage of survival is observed. At €95,970 budget, all the measures are utilised, and this results in a 94.55% survival. In this case, spending more than €11,750 is not economical anymore as it does not make any changes to the survival rate.

•
Given the high infrastructure cost of sprinklers, sprinkler heads are not utilized in the building design until the cost limit surpasses €70,000.

•
The results of the comparison of individual fire safety measures reveal that self-closing fire doors are the most economical and effective measures to hinder the smoke movement and increase the percentage of survival for these two case projects. The sprinklers play a critical role in diminishing the fire spread and smoke movement in the building to prevent high property losses. However, the required time for a sprinkler to be activated and extinguish the fire may be enough to produce a considerable amount of smoke. This leads to injuries of some occupants and threatens the safety of others by blocking their routes to the exits, especially in the residential building case projects.

•
Existing studies use and assess fire safety measures in the building designs and also evaluate safe evacuation to examine effective factors on safe evacuation. However, this study implemented optimisation of fire safety measures to find sets of measures with optimal positions in the building design while considering all of the fire scenarios, which were not taken into account in the previous studies. Unlike existing literature, this research provides optimised fire safety measures with an optimised budget. It helps determine the most appropriate position for fire safety measures considering budget limits, which is a challenge for stakeholders.

Conclusions
Given the importance of safe evacuation in buildings, many researchers studied safe evacuation and utilizing fire safety measures in the building design. However, optimisation of fire safety measures while considering all of the fire scenarios to determine a set of optimised fire safety measures with their position in the building design is missing in the existing literature. Thus, in this study, a framework was proposed to find a set of optimised fire safety measures and a plugin was also developed in the BIM environment for this purpose. This framework includes four phases. First, the identified measures' costs in BIM, and budget limits are introduced to the framework, and then calculations and automatic graph extraction is performed as initial preparation. In the next phase, optimisation is implemented utilising the customized version of the Billiards-inspired Optimisation Algorithm, called BBOA. This is to tackle the optimisation problem that was validated with GA and PSO. The optimisation is conducted according to the effects on safe evacuation versus costs of fire safety measures. Then, the designer decides to select the most appropriate combination and position of measures due to the budget limit and other stakeholders' consideration. Finally, the selected combination of measures is assigned in BIM. This framework modifies building designs at the design stage by utilizing an optimised set of measures and their corresponding positions.
The evaluation of the framework is demonstrated by two case projects, a residential building and a hospital building. The obtained results demonstrated that the framework improved the safety of occupants by increasing the percentage of survival by about 40-50%, which requires a budget of approximately €10,000. Judging by the results, spending more does not enhance the percentage of survival considerably. In other words, spending €10,000 is optimal for applying fire safety measures with their corresponding positions in the building design. Moreover, the considered measures (i.e., sprinkler, self-closing fire door, and emergency exit) were individually compared in terms of effectiveness and economic aspect. In this comparison, self-closing fire doors were found to be the most effective and economic measure to control smoke spread. The results verify that the proposed framework is a beneficial approach for designers to improve the safety of their designs in terms of safe occupant evacuation. In this research, some assumptions are considered in the modelling to simplify implementing the proposed framework. However, in future research, more advanced approaches that require more computations can be employed to enhance the validity of the research. Moreover, the materials' conductivity is an important factor when investigating the fire spread. This research is limited to architectural design and does not consider the materials' conductivity in buildings. Future development of the BIM plugin should lead to taking this factor into account while simulating the fire spread and the subsequent smoke propagation. Last but not least, gaps between components caused by dimensional and geometric variations of components in a building can impact smoke propagation. Future research work is needed to enable the developed BIM plugin to analyse and simulate the impact of such gaps on smoke propagation and the subsequent evacuation of participants.

Conflicts of Interest:
The authors declare no conflict of interest.