A Fire Evacuation and Control System in Smart Buildings Based on the Internet of Things and a Hybrid Intelligent Algorithm

: Concerns about ﬁre risk reduction and rescue tactics have been raised in light of recent incidents involving ﬂammable cladding systems and fast ﬁre spread in high -rise buildings world-wide. Thus, governments, engineers, and building designers should prioritize ﬁre safety. During a ﬁre event, an emergency evacuation system is indispensable in large buildings, which guides evac-uees to exit gates as fast as possible by dynamic and safe routes. Evacuation plans should evaluate whether paths inside the structures are appropriate for evacuations, considering the building’s electric power, electric controls, energy usage, and ﬁre/smoke protection. On the other hand, the Internet of Things (IoT) is emerging as a catalyst for creating and optimizing the supply and consumption of intelligent services to achieve an eﬃcient system. Smart buildings use IoT sensors for monitoring indoor environmental parameters, such as temperature, humidity, luminosity, and air quality. This research proposes a new way for a smart building ﬁre evacuation and control system based on the IoT to direct individuals along an evacuation route during ﬁre incidents eﬃciently. This research utilizes a hybrid nature-inspired optimization approach, Emperor Penguin Colony, and Particle Swarm Optimization (EPC - PSO). The EPC algorithm is regulated by the penguins’ body heat radiation and spiral-like movement inside their colony. The behavior of emperor penguins improves the PSO algorithm for sooner convergences. The method also uses a particle idea of PSO to update the penguins’ positions. Experimental results showed that the proposed method was executed accurately and eﬀectively by cost, energy consumption, and execution time -related challenges to ensure minimum life and resource causalities. The method has decreased the execution time and cost by 10.41% and 25% compared to other algorithms. Moreover, to achieve a sustainable system, the proposed method has decreased energy consumption by 11.90% compared to other algorithms.


Introduction
Because of increased industrialization, large industries are gradually expanding.In most situations, industries do not follow the usual criteria for constructing high-rise buildings, resulting in various accidents, including fires [1].Large public structures are densely occupied and comprise numerous structures and intricate functions.Evacuation is ineffective in the event of abrupt calamities (fire, earthquake, gas leak, etc.) because of the absence of an appropriate evacuation direction [2,3].Electric fires are most frequent during disasters because of the excessive use of electric systems in buildings.Therefore, we need very intelligent systems to control the situation in these cases.Fires are one of the most frequent disasters with destructive effects, which cause astonishingly direct economic losses and threaten personal safety.Therefore, the correct evacuation plan would reduce casualties when a fire broke out.Currently, most buildings use smoke alarms as fire warnings but lack an evacuation guidance system when a fire breaks out.The traditional one-way instruction fire evacuation indicator system is no longer suitable for current building structures; it makes things worse in the most critical moments, leading people to the wrong escape route.A key technology to develop an intelligent evacuation system is using the basic principles of safety evacuation route instruction requirements combined with the typical fire scenarios and architectural space structures to establish a smart evacuation system [4].Additionally, although historic buildings' elevators and other components are unsuitable for evacuation purposes due to weak planning and the risk of damaging electric power, electric controls, and fire and smoke protection, several investigations have been conducted to find a solution.
On the other hand, innovative technologies such as the Internet of Things (IoT) and cloud computing have played vital roles in many applications [5][6][7].As one of the prominent technologies, the IoT plays a vital role in fire evacuation systems.It enables direct human-free communication between them by combining numerous sensors and items.The "things" in the IoT are tangible objects such as sensors that track and collect data [8].With the advent of the IoT, people, things, sensors, and services are constantly connected around the globe [9].The primary goal of the IoT is to offer network architecture with open communication standards and applications to use real and virtual sensors everywhere in a network [10].Many smart products and devices have sensors, allowing them to perceive information about their surroundings in real-time.This occurrence has ultimately resulted in the fascinating idea of the IoT, which connects all smart things and equips them with data analytics to change how we live, work, and play forever.The IoT includes wearable technology, smart cars, sensors, laptops, industrial and utility components, and wearable components [11,12].In recent years, numerous entrepreneurs have adopted and put into practice the idea of the IoT in fields such as intelligent cities, intelligent healthcare, intelligent surroundings, intelligent traffic, etc. [13].
Building fire disaster management systems in smart cities have become required due to the worldwide phenomenon of fire [14] and the increasing significance of fire accidents in structures [15].So, this paper introduces a new energy-aware method to solve the problem of intelligent fire evacuation systems based on the IoT in smart buildings.This paper proposes a hybrid method.The suggested technique finds the quickest and most energyefficient route to the exit and directs the evacuees there using Particle Swarm Optimization (PSO) and Emperor Penguin Colony (EPC) methods.It combines the PSO with the standard EPC algorithm to reach the best particles sooner.The following are the contributions of this study:

•
Decreasing cost in an IoT-based fire evacuation system using a hybrid EPC-PSO method;

•
Decreasing energy consumption in an IoT-based fire evacuation system using a hybrid EPC-PSO method; • Decreasing execution time in an IoT-based fire evacuation system using a hybrid EPC-PSO method.
The following parts make up the rest of the article: There are related works in the second section.The proposed method is outlined in Section 3. Section 4 explores the suggested method and compares it to alternative approaches.Finally, a conclusion and suggested projects are provided in Section 5.

Related Work
In this section, some of the existing methods and algorithms proposed by authors for solving problems in the field of fire evacuation systems are mentioned.
Acharjya and Koley [16] recommended an IoT-based fire crisis architecture addressing fire hazards.The structure has a few sensors that can spot smoke, hazardous gas, and fire within a building.The use of Bluetooth modules for distant sensor connection was also shown.A single unit comprises a Bluetooth module, sensors, and a microcontroller board.The mobile application chooses a safe exit from the building after receiving data from the sensors that recognize the fire hazards.The recommended approach made it feasible to alert disaster management teams and local emergency agencies by sharing the hazardous area via a cloud service.Additionally, in order to assure the promptness and dependability of network-wide communication, a lightweight data-oriented publish-subscribe messaging protocol was used.The outcomes demonstrated that the model might prevent a person's death in a fire.
Mekni [17] proposed a low-cost, intelligent IoT-based fire detection and monitoring system design.Their solution allowed users to remotely monitor the status of a building via an intuitive dashboard that displays data for all metrics on a single page.When a gathered parameter exceeds its threshold, a buzzer, a red light, and a text message are delivered to the homeowner's mobile phone so she/he can phone the authorities to arrive promptly.The proposed method counted the number of individuals at the fire scene, facilitating the evacuation procedure.
For real-time fire detection, monitoring, and evacuation aid, Singh, Birajdar [18] recommended a hybrid solution using 2.4 GHz Zigbee and Long-Range (LoRa).The architecture's five main components are the end device, the safety operation controller, the evacuation path display controller, the gateway, and the vision node.The end device and vision node provide real-time data and visual representations of a fire's progression.In addition, an OPNET simulator Zigbee simulation was performed to examine the network characteristics.The evacuation path display controller implemented Dijkstra's shortestpath algorithm to offer the quickest escape route in the event of a fire.The results showed that the proposed approach for deploying customized hardware for fire detection was superior to prior studies.
Zualkernan, Aloul [19] showed a system that intelligently steered building inhabitants toward a safe evacuation by using IoT technology to track the location of the fire and the occupants.The technique makes use of Bluetooth Low Energy (BLE) beacons to locate people inside using their mobile phones.It also kept an eye on dangerous areas using smoke and temperature sensors.WiFi and DigiMesh were only two of the networks used to increase the system's fire resistance.The recommended technology might support a network of emergency communications covering the whole city.
Khan, Aesha [1] suggested developing an IoT-based intelligent fire evacuation system that could efficiently direct individuals along an escape route in a fire situation.The A* search algorithm controls the primary module of the suggested model.By directing individuals along the quickest, safest route feasible, their suggested approach assisted people in navigating out of danger.The second-best path was displayed if the first ideal path was already occupied.The findings demonstrated that the suggested approach assisted evacuees in reaching the exit and instantly alerted the fire department to the rescue effort.
Aymaz, Çavdar [20] proposed a technique to explore wayfinding during the fire.Wayfinding depends on the building type.Moreover, they investigated the possible influence of smoke, light, and distance on route determination for fire evacuation.When a fire occurs, the system provides evacuation route guidance to people so that they are able to avoid the hazard.Here, Particle Swarm Optimization (PSO) was used to optimize the evacuation route.The results showed that the fire evacuation system could recommend the shortest and safe route.
Lozowicka and Nikonczuk [21] presented the method of using the Genetic Algorithm (GA) to improve the system of evacuation in case a fire were to grow on the ferry "Polonia".The information from the fire detector system concerning the zone cut-off was used.The two-dimensional grid of escape routes was described as a matrix of coordinates.The GA looked for the best evacuation route while taking into consideration the zone where the fire had already grown.The authors presented that the best evacuation way was from the business-class cabin.The fire started at one of the cabins.The results showed that the system signaled escape routes with power-supplied double-direction luminous arrows that could offer the passengers the optimal escape route.
Table 1 compares existing techniques for the fire evacuation and control systems in smart buildings based on the IoT, detailing each technique's objective, the strategy employed, evaluation tools, and performance measures.Tracking the location of the fire and building occupants Proposing a system based on BLE, WiFi, and DigiMesh Testing the system over an area of 1600 m 2

Khan, Aesha [1]
Proposing an IoTbased intelligent fire evacuation system Using JavaScript and MySQL database Dijkstra's algorithm

Aymaz, Çavdar [20]
Exploring the best escape way during a fire evacuation

Lozowicka and Nikonczuk [21]
Improving the system of evacuation Using GA method in the optimization of escape routes Matlab

Methodology
Building fires result in a great number of fatalities and property losses; hence, adequate action must be taken.The effort to create such disaster management systems using information and communication technology has grown, and several studies have been carried out in real-world settings [22].This paper introduces a new method for a fire evacuation and control system in smart buildings based on the IoT to efficiently direct individuals along an evacuation route in the event of fire incidents.First, the system architecture is explained, then a hybrid method is described.

System Architecture
There are various vital issues in integrated smart buildings, such as energy management and fire evacuation systems.The subject here is developing an intelligent fire evacuation system.Figure 1 depicts the system architecture and operating procedure of this work.The system's operation is broken down into the following steps: (1) A fire breaks out within the structure.(2) The building's smoke and fire detectors identify a fire, and an evacuation is initiated.(3) The IoT and Dynamic Cellular Automata (DCA) analysis is initialized.The IoT system begins to monitor smoke and fire alarm signals, analyzes the data of the surveillance camera system, and then uploads the data to the edge computing gateway via the LoRa IoT wireless communication module.( 4) Using a BIM-based visualization system, the DCA model is executed on the edge gateway to determine evacuation routes depending on the current fire scenario and manpower situations.On this basis, the system assigns each sign its direction value.( 5) Using IoT LoRa connectivity, the system transmits signage direction data to smart signage devices in order to direct the audience to evacuate via the ideal route [23].To create the initial population, a number of separate routes from the departure node to the destination node are created.Population size is the total number of people in a population.In this study, the population size is fixed at 100.Every person symbolizes the arrangement of nodes along a path that connects a departure node with a destination node [24].A departure node ID, through-node IDs, and a destination node ID are therefore used to denote the persons.Variable lengths are seen in the people.The person is represented as follows: for instance, if the departure node ID is 1, the destination node ID is 7, and the order of the through-node IDs is 2-4-5 [1,2,4,5,7] (see Figure 2).

Problem Formulation
The current analysis is based on Francis's [25] initial formulation of the building evacuation issue, which took into account the enclosure evacuation optimization.Nevertheless, by narrowing the scope of the issue, we may utilize more accurate models of people's mobility and include behavior models.Consider an enclosure with k inhabitants and n potential exits that are positioned so that there is no obstruction to occupant movement to any of them.We may assume a steady flow via each exit because of how the people are dispersed around the space.Each exit also has an evacuation path; therefore, there will be n distinct evacuation routes, each of length lj and having an access area of aj, for n exits.When every inhabitant of the enclosure has reached his or her destination, the evacuation of the enclosure is complete.The time required for the evacuation is determined by the lengthiest path and is shown by the moment when the final passenger arrives at his or her destination.
To reduce the cost, energy usage, and execution time (z), the following model may be used to predict how many individuals are required [26]: ..∑   = .

𝑛𝑛 𝑗𝑗=1
(2) where j is the exit number, xj is the number of individuals who will evacuate the enclosure by exit j, and tj (xj) is the evacuation function determining how long it will take xj individuals to exit the enclosure.Although the variable xj (the number of persons) should be an integer, most problems with large values of k are regarded as real variables, which are then adjusted to the nearest integer value once the solution is found.In contrast to the negativity requirement of the variables, which states that the number of persons who select a certain route cannot be negative, constraint requires that all k individuals depart the enclosure.

Emperor Penguins Colony (EPC) Algorithm
Algorithm 1 describes the EPC method's pseudo-code [27].These are the guidelines for this algorithm: 1.All initial-population penguins radiate heat and are attracted to one another according to their absorption coefficient.2. It is believed that every penguin's body surface area is the same.3. Penguins ignore the impacts of the earth's surface and atmosphere and absorb all heat radiation.4. The penguins' thermal radiation is considered linear.5. Two penguins are attracted to one another based on the quantity of heat in the space between them.The amount of heat received decreases with increasing distance; on the other hand, it increases with decreasing distance.Throughout the absorption procedure, the penguin spiral moves irregularly and with evenly distributed variance.sort the solutions and find the best one; End Heat radiation transfer can calculate the heat intensity and attraction.Each penguin's body surface area must be calculated to add the heat radiation from each penguin.The subsections that follow provide more information on the aforementioned amounts.Additionally, penguins' synchronized spiral motions have an impact on their indirect movement.

Body surface area
This procedure must calculate thermal radiation, attraction, heat absorption, and spiral movement coordination.The body surface area is required to calculate heat radiation, which is vital to determine heat radiation transmission and compute attractiveness [28].Using Equation (4), the main body surface area Atrunk (m 2 ) is obtained [29].
where  = 2 − 2, a denotes half the body length of the neck, and b is equal to the main trunk's half diameter.Through the cone equation, the beak area (Abeak) is calculated by Equation ( 5): where the beak length is defined as the biggest sectional area of the beak divided by a radius.Equation ( 6) determines the head area using the sphere equation [27]: Ultimately, the flippers are seen as rectangles with dimensions of l and w, which are calculated using Equation (7).

Heat transfer
A route or process function is the transport of heat.As a result, how this procedure proceeds and the system's initial and end states determine how much heat is transported during the thermodynamic process that affects the system's state.The heat transfer coefficient computes the heat flux ratio to the thermodynamic heat.A quantitative, vectorial description of heat movement via a surface is called a heat flux.When objects and their environment reach identical temperatures, thermal equilibrium is reached.There are three different types of heat transfer: thermal conduction, convection, and thermal radiation [30].It is the direct transfer of kinetic energy particles over a barrier between two systems at the microscopic level.Heat convection happens when a fluid's bulk flow transmits heat together with the flow of its constituent parts.The EPC technique uses the radiation heat transfer criteria while disregarding the conduction and convectional heat transfer requirements.The amount of radiation a penguin receives is a determinant of their attractiveness.The warmer penguin is more appealing when there is less distance between a penguin and a warmer penguin.The heat exchange of an emperor penguin is determined using a model of distributed heat transfer.This model assumes that the penguin is in thermal equilibrium with its surroundings and assembles the heat transfers from each part of its body, including its feet, head, and flippers, according to Equation ( 8) [31]: Equation ( 9) can be used to calculate the radiation emitted from each body component of the surface area.
where Qpenguin is heat transfer per unit time (W), and A is the total surface area. is the emissivity of bird plumage, σ is the Stefan-Boltzmann constant, and Ts is the absolute temperature in Kelvin (K) [32].

Heat intensity and attractiveness
Penguins are considered linear heat sources based on their bodies' geometry.Ultimately, we can determine the allure of the penguin by Equation ( 10) by combining the radiation equation with the linear heat source equation: The attenuation factor is µ, and the separation between two linear sources is x.The µ is considered a positive value for determining the convergence rate.The concept of heat absorption grows as the attenuation coefficient falls [27].9. Coordinated spiral-like movements Coordinated spiral-like movements are huddles in which clockwise movement is performed around a fixed center.In this instance, the system's structure has indeterminate limits and a spiral pattern around its core.The temperature is warmest at the huddle's core and significantly colder at its periphery.Penguins do not compete for personal advantage.The entire huddle has a slow spiral motion, allowing each penguin to rotate through all positions [33].Let's imagine that there are two penguins, i and j.The penguin that requires heat is continually moving toward the warmer penguin.Because j in this instance is warmer, the spiral movement is from i to j in this instance.The spiral type in this study is referred to as a logarithmic spiral.Equation (11) takes the logarithmic spiral equation into account: where  is the angle of the x-axis, a and b are constant and are selected randomly, and r shows the distance from the origin.
According to [34], the logarithmic spiral may be created from equally spaced rays when drawing the perpendicular to a neighboring ray after starting along one.As the number of rays approaches infinity, the segmentation pattern resembles a smooth logarithmic spiral.The pace at which penguin i travels a distance in the direction of j is determined by the attraction value, Q. Due to its attraction rating, it cannot reach its destination and stops after traveling a considerable distance.The new location of i is k.This individual knowledge of spiral-like movement can be utilized in future relocations or shared with the entire community.The distance between i and j can be obtained using Equation (12) to determine the equation for this spiral-like motion.
The result is multiplied by attractiveness Q to get the equation of distance i to k according to Equation ( 13): The relation between Cartesian and Polar coordinates () is calculated by Equations ( 14) and ( 15) [35]: where

Particle Swarm Optimization (PSO)
PSO is a population-based optimization tool that can be deployed and utilized to tackle various function optimization issues [36].In the simulation, the behavior of particles is influenced by the best local particle or the best global particle.If the current velocity is added to the current position, a new (future) state will appear.It uses the "particle" to introduce solutions to optimization problems.The location and velocity vectors determine the distance and orientation of particles.The relevant fitness function defines the fitness function related to particles.The particle alters its position persistently by looking for the local optimal.Particles are evaluated iteratively in the treatment area to determine the appropriate treatment.
Imagine that m particles exist in a D-dimensional space, and the particle locations are   = ( 1 . 2 .… .  ); the fitness function is   , and the velocity of a particle at the same time is   = ( 1 . 2 .… .  ) .The best position for a particle i is the value of   = ( 1 . 2 .… .  ), also called   .The best location for whole particles is gbest.The speed and location of PSO are calculated by Equation ( 16) and ( 17) [37]: where    is the speed amount of the particle i in the t iteration.   is the location amount of the particle i in the t iteration.w is the inertia weight utilized to regulate the speed of particle update. 1 ,  2 are stable and frequently are the amounts of 2. Rand () is a random number in [0, 1].∆ is the time interval, often ∆ = 1.
PSO has several advantages, such as easily adjustable parameters, high effectiveness, quick search times, etc., but it is vulnerable to the local optimal solution issue when working with discrete problems.The PSO algorithm must be improved to solve the work planning issue in the multi-robot system.Three methods are used to promote PSO.The PSO method was initially intended to be adapted to discrete treatment space issues through the particle coding and decoding procedure.The "stop" speed would be wrongly reset to evade the particle being stuck in the local ideal.The particle's location would then wrongly reset as it approached the best local solution, enlarging the particle swarm search space and raising the possibility of discovering the gbest.
To find the appropriate place, particles are accidentally examined over the probable treatment range.The particle currently scouts the area around the barrier when it flies over the potential boundary.The particle just needs to be moved to the potential side.The particle can keep searching for the optimum answer no matter how close it is to the border.The calculated function is performed to set the amount to the total of the exceeded boundary amount when the particle is outside the permitted range in order to keep it within the acceptable border location [37].Algorithm 2 depicts the pseudo-code of PSO [38].
Algorithm 2: Pseudo-code of the PSO algorithm.Begin initialize the population with n particles; while (termination creation is not met) gbest ←best Xi among all solutions in the population; Xi←calculate the velocity based on Equation ( 16); update the particles based on Equation ( 17); end for end while End

Hybrid Method
Scholars have used hybrid algorithms to handle optimization problems throughout the last few decades.These hybrid algorithms perform better than their counterparts in solving multiple complex issues [39].Intelligent heuristic algorithms like EPC and PSO have been widely used in optimization.The performance of EPC and PSO has advanced based on ongoing enhancements made to their initial versions.Figure 3 depicts the suggested flowchart.The steps of the proposed combined method are described as follows: Step 1: Population initialization progress: smart building fire evacuation and control system based on IoT control parameters.
Step 2: Choose the basic parameters that will constrain the intelligent fire evacuation system's capabilities.
Step 3: Calculate the cost, energy use, execution time, and fitness metrics.
Step 4: Determine the emperor penguin behaviors' boundaries of huddle circumstances.
Step 5: The relationship between the huddling behavior and the temperature profile may be calculated.
Step 6: Determine the distance between emperor penguins in order to update their locations and choose the best search agents found using the PSO algorithm.
Step 7: The distance and PSO algorithm update the penguins' positions.
Step 8: The emperor penguins' and the fire evacuation and control system in smart buildings based on the IoT boundary circumstances are examined.
Step 9: Update the search agent's location and fitness value.
Step 10: When the algorithm completes the most iterations, it becomes stationary.
Step 11: Show the best-obtained route.A fitness function processes an individual positive integer to represent the route's appropriateness.We have used three main objectives to produce the fitness value achieved from Equation (18).
where F is between 0 and 1.The constants  1 ,  2 , and  3 are weight coefficients [40].The sum of weights equal to one: The elements of the fitness function should be normalized by Equation (20): (20) where N(V) is the normalized value of either cost, execution time, or energy consumption.

Simulation
The presentation of the suggested approach is supported in this section.The success of the suggested strategy must be demonstrated using the performance evaluation.The specifics of the empirical settings, including the simulation environment, dataset, and simulated parameters, are presented in the remaining paragraphs of this section.Lastly, this section describes comparisons and results.

Simulation Environment
Arduino UNO was coupled to an nRF24L01 transmitter for the prototype workstation.In this instance, the Arduino UNO code was configured so that the transmitter functioned as a receiver.Python was employed to collect the sensor data from the mesh, while MATLAB ® was utilized to evaluate the data and activate the emergency system.When executed, the Python script establishes a serial communication port between the Arduino and itself.It constantly verifies serial data.If any data are received, they are transformed into a specified three-byte format before being sent to MATLAB ® .We used MATLAB version R2020a for path planning.We used some libraries and toolboxes in MATLAB, such as Open Genetic Algorithm Toolbox, Genetic and Evolutionary Algorithm Toolbox (GEATbx), and some custom libraries.The MATLAB ® script developed an

End
No Yes occupancy grid matrix where the system was installed upon input from Python (based on pyeasyga, pygalib, and DEAP libraries).The grid matrix can be produced using vectors as inputs in MATLAB's robotics program.MATLAB ® would generate barriers to mimic fire during fire occurrences and then utilize a path-planning algorithm to determine all viable departure routes from each room.The path-planning algorithm computes the lengths to each exit from each room by connecting all the dots, avoiding barriers (walls and spots where smoke detectors detect smoke), and generating numbers based on this path computation.

Dataset and Simulation Parameters
This section tests the four (EPC, GA, PSO, and ALO) on various test scenarios.The basic idea for the GA and PSO are derived from [21], and [20], respectively.Moreover, we used the basic algorithms for EPC and ALO since they had not been used in this problem yet.There are three examples in the literature, and eighty instances with various dimensions and complexity levels were picked randomly.Each of the four algorithms has several parameters.The parameters used in the research are listed in Table 2.

Comparisons
In this section, the obtained results are evaluated.The values obtained from the hybrid method are compared with the results of other algorithms (GA, PSO, and ALO).Calculating the objective function, as illustrated in Figure 4, allows a comparison of the relative performance for various iteration counts.According to Figure 4, the fitness amount ranges from 0 to 1.This simulation looks at the fitness of 200 iterations.The fitness value declines as the number of iterations rises.As can be seen, the fitness amount between the 100th and 200th iterations falls to its lowest point of 0.24.Another crucial test for metaheuristic algorithms is to examine the stability of the associated algorithm.Metaheuristic algorithms are unexpected and uncertain; hence, it is important to look at their stability.If an algorithm returns the same or similar responses for different performances, it is said to be stable.Figure 5 shows that the suggested approach was used 48 times to assess its stability.In the diagrams, the horizontal axis represents the algorithm's execution order, while the vertical axis represents the fitness in each execution order.The recommended algorithm is extremely stable, according to stabilityrelated statistics.The obtained results to assess the criteria parameters of the energy consumption, execution time, and cost are shown in Figures 6-8.Many studies have paid particular attention to energy consumption [41,42].The test of average energy consumption was proposed to measure the routing model's effectiveness in the network's energy efficiency.Figure 6 illustrates the outcomes of this test of the proposed method.They confirm that the hybrid method can deliver better results than other methods due to considering the residual energy of the node, the amount of traffic in the routes of the parent node (which delays queue processing, transmission, and distribution), and also the amount of higher-level parent access.The mean energy usage of the nodes is included in the network time intervals, which indicates the knowledge of the suggested method regarding the energy and status of the network.Moreover, the energy consumption trend in the proposed network will decrease over time.The energy consumption rate of our method decreased at the end of the simulation time compared to other methods.significantly reduce the time to perform the whole process compared to other methods.The results obtained in the experiments of this research show that the cost of the proposed method is reduced compared to the compared methods, i.e., the GA, ALO, and PSO algorithms.As shown in Figure 7, the PSO algorithm, ALO, and GA have the best results after the proposed method.The results of the proposed method for reducing cost compared to other methods are shown in Figure 8.The method was compared to the PSO, ALO, and GA algorithms.The obtained results show that the cost is significantly decreased compared to the previous methods.In the experiment conducted in this research, the results obtained for the cost of the ALO algorithm were better than those of the PSO and GA algorithms.

Conclusions and Future Work
Recently, numerous cities have seen the construction of intricate and lofty structures.Fire safety should be a top priority for architects, engineers, and governments.We understand the value of gathering information in the foreground to help firefighting operations, evacuation protocols, etc., through prior fire experience.Recent developments in IT, data analytics, and other detection and monitoring technologies have allowed academics who study fire safety to rethink fire safety procedures in the built environment.IoT-assisted building fire evacuation is a novel method that enhances evacuation by relying on realtime fire-ground data, such as the nature of the fire and the people, to make escape decisions.This research proposes a hybrid nature-inspired optimization algorithm (EPC-PSO) for smart buildings' fire evacuation and control systems based on the IoT.During fire incidents, MATLAB would produce barriers to simulate flames and then use a path-planning algorithm to identify all feasible exit routes from each room.The path-planning algorithm connects all the dots, avoids obstacles (walls and areas where smoke detectors detect smoke), and generates values based on this path calculation to determine the distances to each exit from each room.Simulated fires were created near two sensors to test the path-planning algorithm.Our proposed method was successfully tested in multiple iterations.Future research will also concentrate on broadening the applicability of this technology to other domains, such as maritime vessels and evacuation within buildings, disaster safety through Web or mobile application services, and preventative measures for optimal catastrophe recovery.We want to retrofit a conventional fire alarm with our prototype and test it to determine how the system would respond in real-world scenarios.Moreover, in the future, we can reduce the number of computation nodes to increase efficiency.

5 Figure 1 .
Figure 1.A fire evacuation and control system architecture in smart buildings based on IoT.

Figure 4 .
Figure 4.The result of convergence in 200 iterations.

Figure 6 .
Figure 6.Comparison of the suggested method's energy consumption with that of the PSO, ALO, and GA algorithms.The obtained results for the execution time criterion are illustrated in Figure7.This figure shows that the hybrid method has the shortest execution time among the investigated methods since it can converge faster than others.Therefore, the proposed methods

Figure 7 .
Figure 7.Comparison of the execution time among the proposed method, PSO, ALO, and GA algorithms.

Figure 8 .
Figure 8.Comparison of the cost between the proposed method, PSO, ALO, and GA algorithms.

Table 1 .
Side-by-side comparison of the studied articles.

Algorithm 1 :
Pseudo-code of the EPC algorithm.

Table 2 .
Used parameters for the experiment.