Visual Language-Aided Construction Fire Safety Planning Approach in Building Information Modeling

: Fires pose an enormous threat to human safety and many spectacular ﬁres in under-construction buildings were reported over the past few years. Many construction sites only rely on ﬁre extinguishers, as under-construction buildings do not contain a permanent ﬁre protection system. Traditional safety planning lacks a justiﬁed approach for the ﬁreﬁghting equipment installation planning in the construction job site. Even though many government agencies made safety regulations for ﬁreﬁghting equipment installations, it is still a challenge to translate and execute these rules at the job site. Currently, the construction industry is devoted to discovering all the possible applications of Building Information Modelling (BIM) technology in the entire phases of the project life cycle. BIM technology enables the presentation of facilities in 3-D and o ﬀ ers rule-based modeling through visual programming tools. Therefore, this paper focuses on a visual language approach for rule translation and a multi-agent-based construction ﬁre safety planning simulation in BIM. The proposed approach includes three core modules, namely: (a) Rule Extraction and Logic Development (RELD) Module, (b) Design for Construction Fire Safety (DCFS) Module, and (c) Con-ﬁre Safety Plan Simulation (CSPS) Module. In addition, the DCFS module further includes three submodules, named as (1) Fireﬁghting Equipment Installation (FEI) Module, (2) Bill of Quantities (BoQs) for ﬁreﬁghting Equipment (BFE) Module, and (3) Escape Route Plan (ERP) Module. The RELD module converts the OSHA ﬁre safety rule into mathematical logic, and the DCFS module presents the development of the Con-ﬁre Safety Planning approach by translating the rules from mathematical logic into computer-readable language. The three sub-modules of the DCFS module visualize the outputs of this research work. The CSPS module uses a multi-agent simulation to verify the safety rule compliance of the portable ﬁreﬁghting equipment installation plan the system in a BIM environment. A sample project case study has been implemented to validate the proof of concept. It is anticipated that the proposed approach has the potential to helps the designers through its e ﬀ ectiveness and convenience while it could be helpful in the ﬁeld for practical use.


Introduction
The construction sector includes many unhealthy and unsafe activities, which lead to discouraging workers, delay project progress, affect the cost, reduce productivity, damage reputation and eventually cause human fatalities and injuries [1]. Despite much efforts, construction job sites are still known to be one of the hazardous worksites due to high accidents rate, and thus construction safety remains a vital issue in many countries. Among the construction site accidents, fires pose a significant threat to human safety. Fire safety management must be a concern for every business, but it is particularly important Likewise, many construction job sites, unfortunately, do not apply the safety rule-based fire safety planning for portable firefighting equipment installation. The Occupational Safety and Health Administration (OSHA) stipulates that the site-specific safety plan should include a fire protection plan for every construction project [23]. In case of fire during the construction phase, the workers in the job site must be aware of escape routes and necessary relevant information about the fire extinguisher. The vital factor is to ensure the equipment is perfectly located and in good order. The scope of this paper is limited to the appropriate placement of the firefighting equipment, while the perfect order issue will be addressed in another research paper. In order to enhance the construction fire safety planning, this paper proposed a safety rule-based visual programming approach for the appropriate portable firefighting equipment installation plan. Figure 1 explains the conceptual framework for the fire safety planning in construction, which is named as the Con-fire Safety Planning (CSP) approach. Related safety rules for portable firefighting equipment's installation are extracted from the construction best practices and OSHA database. As depicted in Figure 1, visual programming is employed to translate the safety rule into machine-readable language, which provides the four outputs: (1) portable firefighting equipment installation plan, (2) bill of quantities for the required portable firefighting equipment, (3) the multi-agent simulation to evaluates and validates the compliance of installation plan with the related OSHA safety rule. This research also integrates the escape route planning for the construction workers as well as the required quantity estimation for the portable firefighting equipment.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 3 of 19 Likewise, many construction job sites, unfortunately, do not apply the safety rule-based fire safety planning for portable firefighting equipment installation. The Occupational Safety and Health Administration (OSHA) stipulates that the site-specific safety plan should include a fire protection plan for every construction project [23]. In case of fire during the construction phase, the workers in the job site must be aware of escape routes and necessary relevant information about the fire extinguisher. The vital factor is to ensure the equipment is perfectly located and in good order. The scope of this paper is limited to the appropriate placement of the firefighting equipment, while the perfect order issue will be addressed in another research paper. In order to enhance the construction fire safety planning, this paper proposed a safety rule-based visual programming approach for the appropriate portable firefighting equipment installation plan. Figure 1 explains the conceptual framework for the fire safety planning in construction, which is named as the Con-fire Safety Planning (CSP) approach. Related safety rules for portable firefighting equipment's installation are extracted from the construction best practices and OSHA database. As depicted in Figure 1, visual programming is employed to translate the safety rule into machine-readable language, which provides the four outputs: (1) portable firefighting equipment installation plan, (2) bill of quantities for the required portable firefighting equipment, (3) the multi-agent simulation to evaluates and validates the compliance of installation plan with the related OSHA safety rule. This research also integrates the escape route planning for the construction workers as well as the required quantity estimation for the portable firefighting equipment. The significance of the fire safety management, fire accident statistics, current prevention methods, gap in the current fire safety management process, and objectives (solution to the gap) of the research has already been revealed in the introduction section (see Section 1). Next, the literature review (Section 2) presents the current fire safety management status, construction safety planning and fire safety in the design phase, and advance techniques already been applied to the construction safety planning. The system framework constituent of three main modules and three submodules for prototype development. The applicability of the approach is validated through a case study detailed in Section 3. The results and limitations of the research are discussed in Section 4. Finally, this study is ended with the conclusion and future recommendations (Section 5).

Fire Safety Management, Construction Planning and BIM Applications
In this regard, to understand about the gap in the literature, fire accident and fatalities reports are reviewed with respect to the current preventive measures developed by different researchers and are summarized as current fire safety management status in construction. Insufficiencies in The significance of the fire safety management, fire accident statistics, current prevention methods, gap in the current fire safety management process, and objectives (solution to the gap) of the research has already been revealed in the introduction section (see Section 1). Next, the literature review (Section 2) presents the current fire safety management status, construction safety planning and fire safety in the design phase, and advance techniques already been applied to the construction safety planning. The system framework constituent of three main modules and three submodules for prototype development. The applicability of the approach is validated through a case study detailed in Section 3. The results and limitations of the research are discussed in Section 4. Finally, this study is ended with the conclusion and future recommendations (Section 5).

Fire Safety Management, Construction Planning and BIM Applications
In this regard, to understand about the gap in the literature, fire accident and fatalities reports are reviewed with respect to the current preventive measures developed by different researchers and are summarized as current fire safety management status in construction. Insufficiencies in contemporary fire safety planning were contemplated herein with advanced techniques such as BIM and visual language-based design for safety concepts. Previous efforts on rule-based safety planning are thoroughly studied, and the inevitability of the proposed safety rule-based firefighting equipment installation plan is established.

Current Fire Safety Management Status in Construction
Occupational Safety and Health (OSHA) reported that one out of five workplace fatalities is the death of a worker from construction [24]. According to the data published by the Federal Emergency Management Agency (FEMA) of the United States (US), approximately 4800 fire accidents annually happened on construction sites [25]. The fire safety engineering emerged in the early 20th century as a response to the fire problem caused by the industrial revolution [6]. The growing urbanization and socioeconomic development reflected an increase in the construction of industrial and civil projects. In recent years, the fire in construction projects was frequently witnessed, and some of them have brought a considerable loss of casualties and property damage [21].
In order to tackle the fire safety problem after the number of severe accidents, several countries around the globe have adopted a series of activities such as fire provisions, fire safety inspections, and up-gradation of fire safety codes [26]. Many early warning systems with different technological approach has been developed for the detection of heat and smoke such as Very Early Smoke Detection Apparatus (VESDA) [10], and Cygnus wireless alarm system [27]. A safe evacuation plan for human is very crucial during fire accidents. BIM-based disaster prevention management system was developed by offering built-in functions such as escape route planning, training, and maintenance record keeping feature for fire safety equipment [17]. In order to understand human behavior during burning tragedies and evacuation, a BIM-based serious human rescue game simulation method was proposed [28]. Generally, construction projects include a vast number of complicated tasks with a tight schedule and fire safety provisions [29]. To ensure the safety from fire in complex buildings, escape routes planning and fire extinguishers are just used to save oneself [15]. Computational Fluid Dynamics (CFD) has been applied to assess the internal condition of the construction workplace during the fire situation [30]. To meet the fire safety requirement, the CFD method is currently common in the design process of construction work. Liu et al. proposed an index system based on-site specification for fire hazard assessment in construction using the fuzzy mathematical method [21].

Construction Safety Planning and Fire Safety
Fire safety planning holds a key position in the domain of construction safety planning. However, fire safety planning is carried out separately from the project design phase. In the construction industry, the provision of portable firefighting equipment is considered the sole obligation of the contractor [31]. Currently, the construction industry follows site-specific fire safety planning practices [32,33], which need to be reviewed and updated with intervals [34]. Consequently, comprehensive fire safety planning that includes escape route plans, firefighting equipment installation plans, and mandatory education for workers can be an enormously labour-intensive job if done manually. Therefore, updated and practical fire safety plans are not provided in many construction projects [35].
Emerging technologies such as big data, BIM and other computer-aided simulations offer new ways to improve construction safety planning [36]. In order to enhance traditional construction safety management, many researchers have contributed the elementary research studies towards the design for safety concepts [19,[36][37][38][39]. For instance, a tool to support the hazard identification inherited in the construction process and component, named as design for safety process (DFSP), has been developed by Hadikusmo and Rowinson [40]. Zhang et al. developed a BIM-based safety rule checking system to identify fall hazard through automated checking of 3D models in the design phase. To enhance construction safety planning in the design phase, another study from the same author proposed ontology-based semantic modeling for safety knowledge [41]. A safety rule-based modeling approach has been applied to deal with the excavation related risks, such as cave-in, fall, prohibited zone identification, egress, and ingress [19].
On the contrary, some studies have focused on the BIM application in the design for fire evacuation assessment [17], equipment maintenance, escape route planning, and safety education [16]. However, there is a lake of integration for firefighting equipment installation planning and its integration with fire safety management. Hence, the OSHA rule-based visual language approach is developed to enrich construction fire safety planning.

BIM and Visual Languages
Generally, the safety management process comprises two aspects, namely safety planning and safety monitoring. Surprisingly, safety planning is generally considered the contractor's liability and thus usually gets ignored in the design phase. However, this concept is being changed due to extensive studies recently considered new technologies such as Building Information Modelling. BIM is actively applied to develop rule-based checking systems for building permits [42]. Many studies have currently developed various algorithms to improve safety planning using BIM-based automatic safety rule checking for unsafe design [43], excavation safety modeling [19], BIM-based scaffolding planning [44], and schedule integrated limited access zone identification and visualization [41]. However, fire safety planning has yet covered education and escape route planning so far.
To translate Korean natural language into computer-readable language, the Korean government has developed KBimCode rule interpretation authoring plug-in, as a part of research [45]. Instead of a hard-coded approach for text-based rule translation into computer understandable language, visual language approaches and parametric input tables have been adopted in different studies recently, such as KBimcode [42], Auto-Exca safety modeling [19], and automated scaffolding risk analysis using BIM [46]. On that account, this research work also utilized the visual language for the development of fire safety management system for construction.

Need for Rule-Based Firefighting Equipment Installation Plan
The previous efforts on fire safety management and have been reviewed to understand about the accidents and its prevention methods. With this regard, it is concluded that the construction industry currently is focusing on disaster prevention management, which includes escape route planning, fire safety equipment, and educational training intended to ensure the personal safety of individuals [17]. However, conventional disaster prevention methods still depend on manual operating procedures, which is cumbersome. For instance, as a permanent fire safety prevention system that is usually available in build buildings do not exist in many construction job sites. So, they utterly rely on fire extinguishers or water tanks. Average people do not easily understand the correct position for those fire extinguishers in a job site. In the last decade, extensive studies have been carried out by various researchers which reveal the absence of reactive tools to support designers regarding safety in construction [38]. Traditionally, the designer remains surprisingly not aware about the impact of fire safety considerations in the design stage [18]. However, recent advances in fire safety management have disclosed the potential value of fire safety in the design stage. Therefore, a more creative and user-friendly solution is required to sort out the issue. To do so, considering fire safety equipment planning and appropriate allocation in the design stage is inevitable.

Structure of Con-fire Safety Planning Approach
The propose system framework for Con-fire Safety Planning Approach consists of three main modules, as revealed in Figure 2, namely: (a) Rule Extraction and Logic Development (RELD) Module, (b) Design for Construction Fire Safety (DCFS) Module, and (c) Con-fire Safety Plan Simulation (CSPS) Module. As depicted by Figure 2, the RELD module is intended to extract the fire safety rules and offer the mathematical structure to the DCFS module. The DCFS module converts mathematical information to computer-readable data by using visual programming tools. This module further includes three sub-modules, named as (1) Firefighting Equipment Installation (FEI), (2) BoQs for firefighting Equipment (BFE), and (3) Escape Route Plan (ERP). The three main modules depict the entire process overview of the Con-fire Safety Planning approach, while the three sub-modules profoundly illustrate the DCFS module. The functions and systematic process of the proposed approach in each module are described in the subsequent sections.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 6 of 19 (2) BoQs for firefighting Equipment (BFE), and (3) Escape Route Plan (ERP). The three main modules depict the entire process overview of the Con-fire Safety Planning approach, while the three submodules profoundly illustrate the DCFS module. The functions and systematic process of the proposed approach in each module are described in the subsequent sections.

Rule Extraction and Logic Development (RELD) Module
Accident reports offer vital information such as root causes, responsible roles, and recommended preventive techniques for the avoidance of future accidents. To understand the fire hazards and its preventive methods in construction, this research work was initiated with the assessment of accident reports. Deployment of portable firefighting equipment was found the crucial preventive measure in case of typical under-construction works, while installation of the sprinkler system was noticed vital for fire-sensitive projects such as steel-related projects and tunnels.
In order to ensure a safe environment in terms of fire mishaps, OSHA regulations for fire protection and prevention are investigated in the second step. The safety-related fire regulations have been extracted from the OSHA database. These regulations provide lessons learned from the past and current best practices to minimize the probability of accidents in the construction workplace. Table 1. revealed the OSHA standard number 1926, which describes the related safety and health regulations to the construction industry. Fire protection and prevention rules are depicted under the subpart-F of construction safety and health standard (1926). The standard number 1926.150 demonstrates the fire protection rules, which include general requirements, water supply, portable firefighting equipment, fixed firefighting equipment, and fire alarm devices, as listed in Table 1.

Rule Extraction and Logic Development (RELD) Module
Accident reports offer vital information such as root causes, responsible roles, and recommended preventive techniques for the avoidance of future accidents. To understand the fire hazards and its preventive methods in construction, this research work was initiated with the assessment of accident reports. Deployment of portable firefighting equipment was found the crucial preventive measure in case of typical under-construction works, while installation of the sprinkler system was noticed vital for fire-sensitive projects such as steel-related projects and tunnels.
In order to ensure a safe environment in terms of fire mishaps, OSHA regulations for fire protection and prevention are investigated in the second step. The safety-related fire regulations have been extracted from the OSHA database. These regulations provide lessons learned from the past and current best practices to minimize the probability of accidents in the construction workplace. Table 1. revealed the OSHA standard number 1926, which describes the related safety and health regulations to the construction industry. Fire protection and prevention rules are depicted under the subpart-F of construction safety and health standard (1926). The standard number 1926.150 demonstrates the fire protection rules, which include general requirements, water supply, portable firefighting equipment, fixed firefighting equipment, and fire alarm devices, as listed in Table 1.
Portable firefighting equipment plays a significant role to deal with the construction fire, as many job sites do not contain permanent firefighting systems [3]. Since the distance between the portable firefighting equipment with the persons working in the area also influence the reactive time required to control the fire when it is in the initial stage, OSHA construction fire standards specify the limit of the distance between the persons and firefighting equipment. According to OSHA, "A fire extinguisher, rated not less than 2A, shall be provided for every 3000 square feet of the protected building area, or major fraction thereof. Travel distance from any point of the protected area to the nearest fire extinguisher shall not exceed 100 feet." To limit the scope of the work, this paper merely considers portable firefighting equipment planning for further research. Apart from that, this research also generates an escape plan as an employee emergency route plan. The manually extracted regulations relevant to fire protection are converted into mathematical logics from text-based information, which is then employed for visual programming in the Design for Construction Fire Safety (DCFS) Module. The following conditions are extracted from the OSHA fire safety rules for construction.
(1) Placement of at least one fire extinguisher of type, rated not less than 2A, for the area of 3000 square feet.
(2) The distance from any point of the protected area to the nearest fire extinguisher should be less than or equal to 100 feet while using the fire extinguisher type, rated not less than 2A.
Distance f rom any point ≤ 100 f eet f or rated ≥ 2A (3) In the case of using a fire extinguisher, rated not less than 10B, the distance from any point of the protected area to the closest fire extinguisher should be less than or equal to 50 feet.
Distance f rom any point ≤ 50 f eet f or rated ≥ 10B

Design for Construction Fire Safety (DCFS) Module
The Design for Construction Fire Safety (DCFS) module is a significant module of this research work. This section is devised to convert mathematical logics into computer-readable data, which is obtained from the Rule Extraction and Logic Development (RELD) module. Figure 2 illustrates the system architecture for the Con-fire Safety Planning approach. A commercially available Visual programming language (VPL) tools, named as Grasshopper (BIM authoring platform and a plug-in for Rhinoceros) and Dynamo (BIM authoring platform and a plug-in for Autodesk Revit) were availed to achieve the task of rule conversion. Visual programming is employed in this research study due to several reasons. It is relatively convenient to use as compared with other programming languages [19] such as python, java, and many more. This language effectively represents the information flow through visual symbols (nodes and connections) [42] with precise inputs and outputs. Therefore, this paper proposed a visual language approach for the translation of fire safety rules, which is established from the subpart F (Fire Protection and Prevention) of the OSHA-1926. This module further contains three submodules of the proposed approach.

Design for Firefighting Equipment Installation (FEI) Module
This subsection focuses on fire protection and leverages the visual language approach to acquire BIM-based portable firefighting equipment safety planning in construction. The script is initiated with the extraction of geometric data as input from the 2D plan. As depicted in Figure 3, the method allows the user to define the following four (U1, U2, U3 and U4) conditions: U1 is importing building borderlines (BL) as a 2D plan geometry, U2 is to determine the plan interior walls (IW) as a 2D line geometry, U3 is to define stair locations (SL) as pick points, and U4 is intended to choose fire extinguisher type from the dropdown list that includes type 2A and 10B. According to the OSHA rules, 1926.150(c)(1)(i) A fire extinguisher, rated not less than 2A, shall be provided for every 3,000 square feet of the protected building area, or significant fraction thereof. Travel distance from any point of the protected area to the nearest fire extinguisher shall not exceed 100 feet. Where the Dividing Distance of 2A (DDA) fire extinguisher type is 100ft, and the area is 3000 square feet. Similarly, The OSHA article 1926.150(c)(1)(vi) revealed the Dividing Distance of rated not less than 10B (DDB) fire extinguisher type is 50 feet. availed to achieve the task of rule conversion. Visual programming is employed in this research study due to several reasons. It is relatively convenient to use as compared with other programming languages [19] such as python, java, and many more. This language effectively represents the information flow through visual symbols (nodes and connections) [42] with precise inputs and outputs. Therefore, this paper proposed a visual language approach for the translation of fire safety rules, which is established from the subpart F (Fire Protection and Prevention) of the OSHA-1926. This module further contains three submodules of the proposed approach.

Design for Firefighting Equipment Installation (FEI) Module
This subsection focuses on fire protection and leverages the visual language approach to acquire BIM-based portable firefighting equipment safety planning in construction. The script is initiated with the extraction of geometric data as input from the 2D plan. As depicted in Figure 3, the method allows the user to define the following four (U1, U2, U3 and U4) conditions: U1 is importing building borderlines (BL) as a 2D plan geometry, U2 is to determine the plan interior walls (IW) as a 2D line geometry, U3 is to define stair locations (SL) as pick points, and U4 is intended to choose fire extinguisher type from the dropdown list that includes type 2A and 10B. According to the OSHA rules, 1926.150(c)(1)(i) A fire extinguisher, rated not less than 2A, shall be provided for every 3,000 square feet of the protected building area, or significant fraction thereof. Travel distance from any point of the protected area to the nearest fire extinguisher shall not exceed 100 feet. Where the Dividing Distance of 2A (DDA) fire extinguisher type is 100ft, and the area is 3000 square feet. Similarly, The OSHA article 1926.150(c)(1)(vi) revealed the Dividing Distance of rated not less than 10B (DDB) fire extinguisher type is 50 feet. In the FEI Module, the algorithm uses the Voronoi Grid to generate a building centerline (CL), as shown in Figure 3. The building centerline (CL) used in this research refers to a 2D line located in the center of a closed curve of the building borderline (BL). To generate the fire extinguisher's initial locations, the program divides the building centerline by the number of the fire extinguisher In the FEI Module, the algorithm uses the Voronoi Grid to generate a building centerline (CL), as shown in Figure 3. The building centerline (CL) used in this research refers to a 2D line located in the center of a closed curve of the building borderline (BL). To generate the fire extinguisher's initial locations, the program divides the building centerline by the number of the fire extinguisher obtained from the division of the surface area of the building and the advised required area by OSHA, which is 300 square feet. Thereafter, these initial locations are moved to their closest interior walls (IW) in order to create a fire extinguisher location (EL). The algorithm divides building borderline (BL) into a random number of points (A) to test the shortest walk distance between BL and EL. The algorithm verifies the appropriate location of the fire extinguishers by using the shortest walk logic. The shortest walk logic is a pre-designed component in the visual programming tool (grasshopper). It populates the building surface geometry with points then creates connection lines between points using proximity two-dimensional logic. After that, the algorithm calculates the shortest walk between the locations of random points A and their nearest fire extinguisher cluster locations (EL) and calculates a network of paths between them. The system then measures the closest route curve length (D) and evaluate it in an if statement: as, If D is less or equal to distance advised by the rule that could be DDA or DDB (based on the user selection U4), then do nothing, If D is higher than U4 then divide D over U4 and round up as illustrated in the below equation.
if(D ≤ U4), Return Null else Roundup D

U4
Based on the result of the if statement, the algorithm considers the addition of new fire extinguisher to the existing fire extinguisher cluster. Then, the system automatically moves the fire extinguisher cluster to the closest wall (interior walls imported by the user) and moves in the z-direction by 3 ft. The algorithm creates this portable firefighting equipment plan inside the rhinoceros environment as an (.obj) file. Then this plan is integrated into the BIM model inside a commercially developed Revit program using Rhinoceros WIP add-on.

BoQs for Firefighting Equipment (BFE) Module
This submodule is envisioned to develop a creative solution for estimating the Bill of Quantities (BoQs) for portable firefighting equipment using the visual programming approach. Currently, tools for digital quantity take-off revolutionized the cost estimation aspect in the design stage by saving the time, increased accuracy, and are sophisticated enough to be used. However, to take the cost estimation process to the next level, additional concentration is needed to propose a more creative solution. To do this, a rule-based visual algorithm supported safety information model, which has a fire extinguishers placement plan obtained from the firefighting equipment installation (FEI) module.
Based on the fire extinguisher's placement plan, the system will automatically calculate the quantity take-off for the required portable firefighting equipment. The quantity take-offs list is exported to Microsoft Excel (Ms. Excel) for the cost estimation. Cost estimator and quantity surveyors with this powerful built-in function can quickly develop the required cost plan of the fire protection equipment for the project. In order to generate the quantity, take off, required data was acquired from the Firefighting Equipment Installation (FEI) Module.
The categoric process of the algorithm development for this module can be seen in Figure 3. The visual algorithm is designed to automatically extract the list of geolocations for each fire extinguisher (x-coordinates, y-coordinates, and z-coordinates) from the previous FEI module. The system will calculate the number of locations and generate quantity take-off for the fire extinguishers. The code will then merge the quantity take-off with the predefined fire extinguisher specification. The designed approach also establishes the tag codes of each fire extinguisher (see the details in the case study). The program generates the choices for the users by using the default database, such as relevant data associated with the fire extinguishers chosen by the user, such as manufacturer, family, expiry, and inspection date. As a byproduct of the proposed construction fire safety planning, the program automatically generates a bill of quantities report in excel format (.xls) and saves it on the local machine.

Escape Route Plan (ERP) Module
The purpose of this submodule is to develop the escape route plan for humans in case of an emergency evacuation. The concept of an escape route plan is not new and has been extensively studied by many researchers. An automated escape route plan establishing tools for emergency evacuation has also been developed recently in some commercially available software. The proposed approach in this paper also offers the integration of the escape route plan module. The devised script computes the escape route from the doors of the rooms towards the designated emergency exits.
The visual script developed in Dynamo, available for generation of the fire escape plan with an open application programming interface (API) is integrated with the designed approach for portable firefighting equipment plan. The dynamo script automatically extracts the level of the building as an input. The designed algorithms need few predefined conditions as inputs such as specifying circulation area, regular doors location, and emergency exits. The program deals with the corridor/lobby/stairs as a space family (Stairs are added separately as the category). Once the user defines and highlights the main exit, emergency exit, and staircases as a destination and click the evacuation path button, then the designed algorithm generates a grid on the interest region using the Dulaney triangulation grid method. The Dulaney triangulation is the alternate of the Voronoi grid logic and is used in the dynamo (a plug-in to the Revit). Eventually, the system applies the shortest walk logic from the regular doors to the nearest exit doors, which generate an appropriate fire escape plan and visualize back it in the Revit. The generated escape route plan can be seen in the case study.

Con-fire Safety Plan Simulation (CSPS) Module
The con-fire safety plan simulation module further verifies and evaluates the OSHA rule-based Con-fire Safety Planning (CSP) approach. This algorithm uses a minimalistic and lightweight crowd simulation library named as PedSim, which is based on the social forces model algorithm [47] and offers a real-time multiple pedestrian simulation in Grasshopper. In PedSim, people move from Start Gate (SG) to Destination Gate (DG), following the best route, avoiding obstacles, and other people. In this research, the Start Gate (SG) means the starting point of an agent and Destination Gate (DG) is the nearest fire extinguisher location (EL) point. The algorithm once again divides the borderline of the building (building envelope) (BL) into several points (in our case) within 100ft distance from each other and offsets them inside the building to be used as a Start Gate (SG). These points will act as start gates for Human Agent (HA), which could be increased or decreased based on user choice and the level of accuracy required for simulation. However, increasing these points (start gates) on the borderlines will reflect an increase in the computational process. The interior walls (IW) are used as obstacles for the agents to avoid in the simulation. The target destination (DG) of the agents is the closest fire extinguisher location (EL). The simulation shows the live indicators: (1)agent position, (2) the body radius, (3)velocity, (4)acceleration, (5) current path, (6) behaviors as list (6.1) maintain closeness to goal, 6.2) obstacle collision avoidance force, 6.3) anticipatory collision avoidance force, 6.4) passive collision avoidance force. The simulation generates a heat map of the agents' trace movement showing the most used corridors and paths by the agents to reach their closest fire extinguisher by using GridPersonCounter component in the grasshopper. The travel distance of any agent A (human) towards the closest portable firefighting equipment is updated in the table. In this way, we can see the traveled path of the agent, and our system shows that every generated agent is in the range of 100 ft (1200 inches).

Case Study
This section validates a case study carried out to evaluate the approach by using a sample project from the Autodesk Revit file. The aim was to apply the Con-fire Safety Planning approach developed for portable firefighting equipment installation, bill of quantities estimation, and escape plan. Figure 4 demonstrates the Isometric view and plan of the sample project. The 2D blueprints made in Revit with the entire property's information was used for the experiment. In order to conduct the experiment in a common environment, an add-in to the Revit, Rhino WIP package was installed on the local machine. The designed visual algorithm was imported from the rhinoceros-Grasshopper to the Revit and Rhino-Grasshopper environment using the WIP package. The sample project from the Revit was opened, and exterior walls were converted into a closed curve. The stair landing locations were highlighted by a point object. The interior wall partitions were grouped as curve objects. The user chose the desired family type of the fire-extinguishers from the top-down list, such as 2A or 10 B; in our case study, we assumed 2A. Then the program generates the optimized building centerline using VORONOI grid logic. The program finds the best locations for the fire extinguishers using shortest walk logic and calculates the distance between the building envelope (border), and the fire extinguishers then add additional fire extinguishers in the area longer, outside the range of the selected fire extinguishers type. By pressing the run button for the fire extinguishers plan, a portable firefighting equipment installation plan is generated.
Revit was opened, and exterior walls were converted into a closed curve. The stair landing locations were highlighted by a point object. The interior wall partitions were grouped as curve objects. The user chose the desired family type of the fire-extinguishers from the top-down list, such as 2A or 10 B; in our case study, we assumed 2A. Then the program generates the optimized building centerline using VORONOI grid logic. The program finds the best locations for the fire extinguishers using shortest walk logic and calculates the distance between the building envelope (border), and the fire extinguishers then add additional fire extinguishers in the area longer, outside the range of the selected fire extinguishers type. By pressing the run button for the fire extinguishers plan, a portable firefighting equipment installation plan is generated. In order to change the shape of the building to obtain a more verified evaluation from the case study, we added one big room to the building shown in Figure 4. To further explains the process flow of the developed algorithm, the graphical illustration of the process workflow is depicted in Figure  5. This graphical illustration includes five sections. In Section 1 (S-1), the user needs to define the algorithm inputs: building outline, interior walls, stair locations, and fire extinguisher type. As illustrated in Figure 5, the intent of Section 2 (S-2) is to generate a centerline (CL) of the given building 2D plan using a Voronoi grid after evaluating the continuous line clusters among the grid collection. Subsequently, in order to locate the initial position of portable firefighting equipment, the algorithm divide centerline (CL) in several segments to generate points based on user preferences (U4= fire extinguisher type). Afterward, the program moves the fire extinguishers to the nearest interior walls. In Section 2 of the Figure 5, the Voronoi Grid demonstrates that how the program generates proximity 2d grid in the interior space surface. After that, the algorithm divides the building borderline (BL) into specific segments for the generation of random points (as mentioned in Section 3.2.1). Thereafter, the program uses the shortest walk path logic to generate the shortest path from the A points to the fire extinguisher location (EL); in this case study, we named it as point B (see Figure 5 of Section 3). Moreover, Section 3 also visualize the shortest walk from the collection of path solutions and measures the distance between the building's borderline to the fire extinguishers for further evaluation. The intention of the fourth section (S-4) is to highlight the outreach (longer) paths by using the lightweight crowd simulation library called PedSim, as an add-on in Grasshopper, a multiagent simulation to verify the compliance of portable firefighting equipment plan with OSHA rule. In order to change the shape of the building to obtain a more verified evaluation from the case study, we added one big room to the building shown in Figure 4. To further explains the process flow of the developed algorithm, the graphical illustration of the process workflow is depicted in Figure 5. This graphical illustration includes five sections. In Section 1 (S-1), the user needs to define the algorithm inputs: building outline, interior walls, stair locations, and fire extinguisher type. As illustrated in Figure 5, the intent of Section 2 (S-2) is to generate a centerline (CL) of the given building 2D plan using a Voronoi grid after evaluating the continuous line clusters among the grid collection. Subsequently, in order to locate the initial position of portable firefighting equipment, the algorithm divide centerline (CL) in several segments to generate points based on user preferences (U4 = fire extinguisher type). Afterward, the program moves the fire extinguishers to the nearest interior walls. In Section 2 of the Figure 5, the Voronoi Grid demonstrates that how the program generates proximity 2d grid in the interior space surface. After that, the algorithm divides the building borderline (BL) into specific segments for the generation of random points (as mentioned in Section 3.2.1). Thereafter, the program uses the shortest walk path logic to generate the shortest path from the A points to the fire extinguisher location (EL); in this case study, we named it as point B (see Figure 5 of Section 3). Moreover, Section 3 also visualize the shortest walk from the collection of path solutions and measures the distance between the building's borderline to the fire extinguishers for further evaluation. The intention of the fourth section (S-4) is to highlight the outreach (longer) paths by using the lightweight crowd simulation library called PedSim, as an add-on in Grasshopper, a multi-agent simulation to verify the compliance of portable firefighting equipment plan with OSHA rule. In this case, the travel distance length is greater than the advised length, so the program creates an additional fire extinguisher on the longer path and moves the new fire extinguisher to the nearest wall. In the last section (S-5), the algorithm uses PedSim and GridPersonCounter component to create a heat map from the multi-agent trace for further analysis. Figure 6 shows the multi-agent simulation results for Con-fire Safety Planning. The multi-agent simulation is adopted using the lightweight crowd simulation library named as PedSim, which is based on the social forces model algorithm. In PedSim, people move from Start Gate (A) to Destination Gate (B), following the best route, avoiding obstacles and other people, as revealed in Figure 6. The building's envelope (border) is divided into several segments with an interval of 100 ft and offsets them inside the building for the purpose as a start gate (A) using the developed algorithm. The program considered interior walls (IW) as obstacles for the agents and avoided in the simulation while traveling to the destination (B) considering the closest fire extinguisher location (EL). The traveled path of the agent and our system shows that every generated agent is in the range of 100 ft (1200 inches) except number 1, which is highlighted in the table of Figure 6.
The table highlighted the agent, which is not in compliance with the OSHA regulations. Thus, new firefighting equipment (fire extinguisher) is added to the fire extinguishers cluster, as shown in the Figures 6-8. The portable firefighting equipment plan depicts the appropriate location of the fire-extinguishers. Figure 7 shows the 3D visualization of the Con-fire Safety Planning (CSP), while Figure 8 depicts the heatmap generated after the CSP simulation.
In addition to the portable firefighting equipment installation plan, the system also generated the bill of quantities for the required equipment. A layer of firefighting equipment family is generated, and the location coordinates of the fire extinguisher are extracted from the 3D-model using visual programming. The program then automatically counts the location and export it to the excel environment. The generated excel report for the quantity take-off can be seen in Figure 9. Similarly, the algorithm automatically saves that report on the local machine of the user.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 12 of 19 In this case, the travel distance length is greater than the advised length, so the program creates an additional fire extinguisher on the longer path and moves the new fire extinguisher to the nearest wall. In the last section (S-5), the algorithm uses PedSim and GridPersonCounter component to create a heat map from the multi-agent trace for further analysis.  Figure 6 shows the multi-agent simulation results for Con-fire Safety Planning. The multi-agent simulation is adopted using the lightweight crowd simulation library named as PedSim, which is based on the social forces model algorithm. In PedSim, people move from Start Gate (A) to Destination Gate (B), following the best route, avoiding obstacles and other people, as revealed in Figure 6. The building's envelope (border) is divided into several segments with an interval of 100 ft and offsets them inside the building for the purpose as a start gate (A) using the developed algorithm. The program considered interior walls (IW) as obstacles for the agents and avoided in the simulation Correspondingly, the visual algorithm already developed for the escape route planning is applied for the purpose of finding the evacuation path. The visual code is downloaded from the GitHub and imported to the dynamo environment. The required packages were installed, and the code was simulated on the 2D plan. The system automatically generated the escape route from the regular doors to the defined emergency doors, as shown in Figure 10. In summary, the portable firefighting equipment installation plan and escape plan is saved as a single .obj file, while the machine automatically stored the bill of quantities as a .xls file.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 13 of 19 Figure 6. Multi-Agent Simulation for the Con-fire Safety Planning The table highlighted the agent, which is not in compliance with the OSHA regulations. Thus, new firefighting equipment (fire extinguisher) is added to the fire extinguishers cluster, as shown in the Figures 6-8. The portable firefighting equipment plan depicts the appropriate location of the fireextinguishers. Figure 7 shows the 3D visualization of the Con-fire Safety Planning (CSP), while Figure  8 depicts the heatmap generated after the CSP simulation.  The table highlighted the agent, which is not in compliance with the OSHA regulations. Thus, new firefighting equipment (fire extinguisher) is added to the fire extinguishers cluster, as shown in the Figures 6-8. The portable firefighting equipment plan depicts the appropriate location of the fireextinguishers. Figure 7 shows the 3D visualization of the Con-fire Safety Planning (CSP), while Figure  8 depicts the heatmap generated after the CSP simulation.  In addition to the portable firefighting equipment installation plan, the system also generated the bill of quantities for the required equipment. A layer of firefighting equipment family is generated, and the location coordinates of the fire extinguisher are extracted from the 3D-model using visual programming. The program then automatically counts the location and export it to the excel environment. The generated excel report for the quantity take-off can be seen in Figure 9. Similarly, the algorithm automatically saves that report on the local machine of the user.  In addition to the portable firefighting equipment installation plan, the system also generated the bill of quantities for the required equipment. A layer of firefighting equipment family is generated, and the location coordinates of the fire extinguisher are extracted from the 3D-model using visual programming. The program then automatically counts the location and export it to the excel environment. The generated excel report for the quantity take-off can be seen in Figure 9. Similarly, the algorithm automatically saves that report on the local machine of the user. Correspondingly, the visual algorithm already developed for the escape route planning is applied for the purpose of finding the evacuation path. The visual code is downloaded from the GitHub and imported to the dynamo environment. The required packages were installed, and the code was simulated on the 2D plan. The system automatically generated the escape route from the regular doors to the defined emergency doors, as shown in Figure 10. In summary, the portable firefighting equipment installation plan and escape plan is saved as a single .obj file, while the machine automatically stored the bill of quantities as a .xls file.

Discussion
This research work presented a framework for construction fire safety planning using a visual algorithmic modeling approach to integrate firefighting equipment installation plans with construction fire safety planning. While previous studies in automated fire safety planning did not consider the rule-based equipment installation plan. The developed visual language and BIM-based con-fire safety planning (CSP) approach integrated firefighting equipment plan as an essential part of the construction fire safety. The case study test of a sample Revit project disclosed that the proposed approach leveraging visual language and BIM technology could provide more advanced and inclusive assessment for the rule-based construction fire safety planning. In order to prevent the fire risks in the construction job site, the designed approach has successfully developed the portable firefighting equipment installation plan semiautomatically, and in compliance with the OSHA guidelines.
Construction safety is not only limited to controlling and managing the safety behavior of the workers, but it also includes the design, procurement, and installation of the safety equipment such as guardrails, safety nets, scaffolding, and firefighting equipment. It is vital to be modeled in BIM for quantification and visualization purposes [36]. As the current fire safety planning practices in the construction industry follows the site-specific fire safety plan [33], which is time-consuming and labour-intensive if it is done with contemporary methods [35]. Based on the complexity and the scale of the project, the tedious modeling process generally needs days or even weeks [36]. However, as mentioned in the literature section, there are many software packages and approaches that can create sophisticated solutions to reduce the workload of the safety planner. This work also proposed a convenient approach to visualize the portable firefighting equipment and determine the actual cost estimation of the portable firefighting equipment with respect to the just on time approach. Hence, it

Discussion
This research work presented a framework for construction fire safety planning using a visual algorithmic modeling approach to integrate firefighting equipment installation plans with construction fire safety planning. While previous studies in automated fire safety planning did not consider the rule-based equipment installation plan. The developed visual language and BIM-based con-fire safety planning (CSP) approach integrated firefighting equipment plan as an essential part of the construction fire safety. The case study test of a sample Revit project disclosed that the proposed approach leveraging visual language and BIM technology could provide more advanced and inclusive assessment for the rule-based construction fire safety planning. In order to prevent the fire risks in the construction job site, the designed approach has successfully developed the portable firefighting equipment installation plan semiautomatically, and in compliance with the OSHA guidelines.
Construction safety is not only limited to controlling and managing the safety behavior of the workers, but it also includes the design, procurement, and installation of the safety equipment such as guardrails, safety nets, scaffolding, and firefighting equipment. It is vital to be modeled in BIM for quantification and visualization purposes [36]. As the current fire safety planning practices in the construction industry follows the site-specific fire safety plan [33], which is time-consuming and labour-intensive if it is done with contemporary methods [35]. Based on the complexity and the scale of the project, the tedious modeling process generally needs days or even weeks [36]. However, as mentioned in the literature section, there are many software packages and approaches that can create sophisticated solutions to reduce the workload of the safety planner. This work also proposed a convenient approach to visualize the portable firefighting equipment and determine the actual cost estimation of the portable firefighting equipment with respect to the just on time approach. Hence, it is anticipated that the development of cost estimate plans could be cycle down from weeks to days or from days to even hours in some cases, depending on the size and complexity of the project. Moreover, the ambiguity of overestimating or underestimate can be eliminated, and the obtain cost information will be shared to others with great certainty. In this research work, the 2-D plan stair location, outline curve, interior walls need to be defined manually, automatic detection of 2D plan elements could be developed using space family tool in BIM environment, where the user does not need to define 2D plan elements and hence could be defined automatically. Moreover, to measure the travel distance trace length, the multi-agent simulation from the building corners towards the fire-extinguishers was out of the scope of this paper, and will be integrated with the future work.

Conclusions
The growing challenges for fire safety concerning economic progress have encouraged the evolution of fire science and technology. Many researchers have currently developed building information modeling (BIM) technologies for construction safety planning to enhance safety in the pre-construction phase, such as checking the BIM model to prevent fall risks, BIM 4D-supported limited access zone identification and visualization, and excavation safety modeling. However, fire safety planning-mainly firefighting equipment planning-still relies on conventional methods and has not yet been appropriately explored. To address the issue, this research work offers rule-based construction fire safety planning using a visual language approach in BIM. The proposed approach includes three core modules, such as the RELD module, DCFS module, and CSPS module. The RELD module converts the OSHA fire safety rules into mathematical logic, and the DCFS module presents the development of the proposed approach, such as the conversion of rules from mathematical logic into computer language. The three sub-modules of the DCFS module visualize the results of the research work, for instance, generation of appropriate portable firefighting equipment planning, bill of quantities of firefighting equipment, and escape route plan. The CSPS module simulates the system into a common BIM environment. The developed fire safety rule-based approach has been successfully implemented in a sample project case study, and the vital benefits are summarized as follows. a.
It is found that the con-fire safety system semi-automatically generates and visualizes the portable firefighting equipment installation plan based on OSHA safety rules, which will minimize the workload and reduce the time of the safety planner. This research depicted that the proposed approach has significant potentials to enhance construction fire safety planning, which is inevitable to deal with the recently reported fatalities and property damages. b.
Integrating firefighting equipment installation plan with the escape route planning is a significant additional contribution of this study. It is anticipated that this approach would help decision-makers in developing practical fire safety plans. This full package of the construction fire safety planning and multi-agent simulation could also be used for the training of the workers and can be extended to the virtual contents by employing Virtual Reality (VR) technology. c.
Portable firefighting equipment installation was witnessed along with their quantity take-off and appropriate locations in the case study. Hence, the con-fire safety system can also predict the location coordinates and required fire preventive resource quantities in advance. Likewise, integrating this fire safety planning with BIM-4D will provide the cost based on the just-in-time approach.
Furthermore, the developed approach could open a new direction of research in the digital twin domain, such as integrating the multi-agent simulation with real humans and updating. In this way, the workers will understand the shortest path towards the fire extinguishers or outside, whatever the case may be. It is expected that the proposed approach has the potential to help designers in practical job sites.