Developing A Conceptual Passive Contact Tracing System for Commercial Buildings Using WiFi Indoor Positioning

: Contact tracing is one of the critical tools for ﬁghting against pandemic disease outbreaks, such as the fast-growing SARS-CoV-2 virus and its different variants. At present, automated contact tracing systems face two main challenges: (1) requiring application installation on smart devices and (2) protecting the users’ privacy. This study introduces a conceptual passive contact tracing system using indoor WiFi positioning to address these challenges and investigate the role of such a system in commercial buildings. In this regard, this study uses a simulated small-ofﬁce layout in a case study to demonstrate the applicability of the proposed system. The special use of the proposed contact tracing system could be academic facilities and ofﬁce buildings, where (1) the WiFi infrastructure already exists and therefore implementing such a system could be cost-effective, and (2) the same users use the facility regularly, enabling the system to notify the users upon a conﬁrmed case once they are back in the building and connected to the WiFi system. Such technology can not only enhance the current automated contact tracing system in commercial buildings by illuminating the need to use smartphone applications while protecting users’ privacy, but could also reduce the risk of infection in indoor environments. The developed system can beneﬁt facility managers, business owners, policy makers, and authorities in assisting to ﬁnd occupants’ high-risk contacts and control the spread of SARS-CoV-2 or similar infectious diseases in commercial buildings, particularly university campuses and ofﬁce buildings.


Introduction
The COVID-19 outbreak has changed different aspects of the routine lives of individuals during the last two years. COVID-19 is a rapidly spreading infectious disease caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2). A total of 4.0 million cases and 143,000 COVID-19-associated fatalities have been reported in the United States as of 25 July 2020 [1]. Beyond the health and human tragedy of the coronavirus, it is now widely recognized that the outbreak triggered the most severe economic crisis since World War II. To prevent the spread of SARS-CoV-2, many cities, states, and countries "locked down", restricting economic activities in non-essential sectors, such as schools and office workplaces [2]. Closing workplaces significantly shrinks the economic output of locked-down regions [2]. In order to safely reopen workplaces in such a condition, it is necessary to implement precautionary actions to avoid the transmission of the virus and track potential transmissions.
It has been proven that person-to-person contacts are the main source of SARS-CoV-2 transmission, especially between people who are physically close to each other (within about six feet) [3]. In addition, according to the Centers for Disease Control and Prevention (CDC) [4], people who are infected but do not show symptoms can also spread the virus to others. Therefore, recent studies assert that contact tracing and quarantining contacted people can be as effective as vaccination in controlling the COVID-19 pandemic and helping other people to be protected [5]. In this situation, a reliable contact tracing system (CTS) could allow individuals to keep track of people's contacts and notify people at risk in social environments. Such a system can detect and inform potentially infected individuals who have made close contact with confirmed cases; therefore, they can start a self-quarantine procedure. The contact tracing system is not only a crucial approach to the COVID-19 outbreak, but it can also be an important system used in similar future pandemics.
In recent years, many studies have utilized new forms of technology for medical purposes in indoor environments. For instance, Sodhro and Zahid proposed a cost-effective framework based on 6G technology and fuzzy-based algorithms in order to provide an e-healthcare system. Since 6G technology allowed artificial intelligence (AI) to be used for intelligent healthcare, the current study uses this technology to monitor the health condition of users [6]. The majority of workplaces (e.g., offices) are located inside commercial buildings. Developing an automated contact tracing system in an indoor space can cause many challenges since GPS technology might not operate efficiently in an indoor environment. At present, the developed automatic contact tracing systems use proximity-based technologies, such as Bluetooth. However, such technologies have limitations, making them unsuitable for constructing a desirable and sustainable contact tracing system. For instance, the users may not always want to turn on their smart devices' Bluetooth because of battery drainage. Moreover, such systems need an additional application to be installed on all users' smart devices (i.e., smartphones). Many users may not be willing to install the application on their smart devices because of privacy issues. In such a situation, indoor positioning technologies can be a valuable tool for the purpose of contact tracing. Indoor localization techniques have been used in buildings for various purposes. In this regard, Filippoupolitis et al. [7] used Bluetooth low energy (BLE), a smartphone application, and BLE beacons along with applying three machine learning algorithms (k-nearest neighbors, logistic regression, and support vector machines) for detecting occupants in order to employ the emergency management of buildings. Therefore, the main purpose of this system is related to building emergency management. In a similar study, Tekler et al. [8] used BLE technology and BLE beacons to monitor and track the occupants in office spaces. Thus, this study highlights tracking occupants in office spaces as one of the main goals of indoor localization systems. The main difference between this study's approach and the previous study is that in this study, the authors do not use smartphone applications for data gathering and their system works based on collecting devices' MAC addresses directly, without interrupting the occupants. Natarajan et al. [9] investigated different occupancy detection and localization strategies that used the Internet of Things for homeenergy-management systems. Accordingly, wireless detection systems, such as Bluetooth and WiFi, were the main technologies that were used for this purpose. In another study, Abolhassani et al. [10] introduced a WiFi-based occupancy system to improve residential building energy simulation. In this research, the authors used WiFi data to investigate occupants' behaviors in buildings. They simulated building energy consumption based on the occupants' behavior patterns using different machine learning algorithms and Energy-Plus software, highlighting occupant behavior as another application of indoor localization technologies. Similarly, Zhou et al. [11] introduced LT-WiOB, which is a cost-effective WiFi-based occupant behavior system that investigates the occupants' behavioral patterns in indoor environments. This system was tested to estimate the rate of energy consumption in buildings. According to the results, the best overall accuracy of this system was 96.1%. Therefore, WiFi indoor positioning is one of the most used indoor positioning technologies to accurately detect users' positions. In addition, commercial buildings (such as university campuses, office buildings, and hospitals) usually have central WiFi infrastructures. A WiFi position system can be set up to track WiFi-enabled smart devices without any additional application. Therefore, the application of indoor WiFi positioning could be efficient and preserve privacy in developing automated contact tracing systems in such commercial buildings. The WiFi positioning technique has been used for tracking occupants and goods in indoor environments for several years. Thus, previous studies applied this technique to track occupants and goods for various reasons, such as controlling HVAC and lighting [12,13] in buildings. However, none of these studies used this WPS for finding occupants' contacts in order to control infectious diseases. This paper introduces a conceptual, passive, contact tracing system for commercial buildings using indoor WiFi positioning technology. This study contributes to the body of knowledge by (1) introducing a privacy-preserving contact tracing system based on indoor WiFi positioning to enhance automated contact tracing in the built environment, and (2) investigating the role of such a system in reducing the number of infected cases in shared public environments, such as office spaces. In other words, this study suggests a contact tracing framework based on WPS, which does not need any additional application to be installed on users' smart devices. Therefore, it is able to track users' contacts in a non-intrusive way. Additionally, this study provides a case study to show how a reliable contact tracing system can prevent occupants in small offices from being infected and its effects in a public indoor environment. This system can be implemented in commercial buildings, especially university campuses and office buildings, to help authorities find occupants' highrisk contacts and control the spread of SARS-CoV-2 or similar infectious diseases.
The remainder of this article is structured as follows: first, a comprehensive literature review is conducted on the existing contact tracing systems, their features, and their limitations. In addition, different WiFi positioning techniques are investigated to evaluate their applications and limitations in the built environment. Then, a passive contact tracing framework is proposed based on a selected indoor WiFi positioning technology to improve the current contact tracing system in commercial buildings by illuminating the need to use smartphone applications while protecting users' privacy. Then, the introduced framework is applied to a simulated small office for validation. Finally, the results are summarized, and the limitations of this study and future research directions are described.

Related Works
This section further discusses the contact tracing application and current contact tracing systems related to the COVID-19 disease. In addition, it investigates previous studies on WiFi positioning systems regarding the techniques, accuracies, and applications.

Contact Tracing Systems
Contact tracing has been crucial in controlling several disease outbreaks, notably SARS, MERS, and Ebola [14]. A contact tracing system is a tool to assist in determining if a person has been in contact with another infected person. Many studies have considered contact tracing technologies in recent years. However, this topic came to view last year, mainly because of the COVID-19 pandemic. It was indicated that close contact is one of the primary sources of SARS-CoV-2 transmission [3]. Thus, contact tracing can help break the chain of virus transmission. The success of contact tracing for interrupting chains of transmission of SARS-CoV-2 and reducing COVID-19-associated mortality relies on the effective quarantine and isolation of contacted individuals. Quarantine refers to the separation of individuals who may have been exposed to the virus but are currently pre-symptomatic, and is distinct from the isolation of symptomatic or confirmed cases [14].
Contact tracing systems aim to warn people who have been in contact with an infected individual to break transmission chains through quarantining [15]. Contact tracing systems have been applied to create a social network that includes individuals' contacts [16]. Generally, a contact tracing system has three steps: (i) identifying the contacts, (ii) listing the contacts, and (iii) contact follow-up. The first step identifies those with whom a person has been in close contact. The second step identifies a list of possible in-danger individuals who have been in close contact with a confirmed, infected case. The last step informs the in-danger individuals for quarantining purposes and performs a follow-up procedure. There are two main practices for contact tracing: manual and automated (the latter is also called digital). Manual contact racing is a slow and inefficient process. In such a system, when a person is diagnosed with the virus, a health inspector interviews him to track his recent contacts. Those people are then notified to stay in quarantine and take tests. Conversely, digital contact tracing uses different technologies to track the contacts and send notifications to potentially infected people by automating the contact tracing procedure.
Many technologies have been used to create an automated contact tracing framework. The new generation of mobile networks, such as 5G, allows mobile operators to track users' movements and find their contacts. In this regard, contact tracing can be implemented using mobile network data [17]. The accuracy of this technology is about 140 m, making it a good solution for large-scale contact tracing. Location-based technologies can also be used for contact tracing. In outdoor environments, global positioning system (GPS) can be a reliable tool for contact tracing [18]; however, this technology has several limitations in indoor environments due to the presence of walls and furniture, which do not allow this system to accurately transmit and receive data. Bluetooth-based proximity tracking technology has been mainly used for indoor contact tracing [19]. Bluetooth-based contact tracing systems use the received signal power from nearby devices. Since this technology does not need to disclose a person's absolute location, it can provide desirable privacy. However, this technology requires additional applications to be installed on smart devices of all individuals to be effective. On the other hand, it may result in the rapid depletion of the smart device's battery, making it a challenging tool to be used by users voluntarily [19].
Different technologies have been utilized by various countries and Big Tech companies to develop their contact tracing framework during the COVID-19 pandemic. Israel considers mobile phone location data in order to track people suspected to be infected with COVID-19. It is a reliable governmental contact tracing system. However, it might create privacy issues for the users because the government can access users' private information, such as the record of places they have visited [20]. The first country that used a smartphone application based on Bluetooth technology for contact tracing was Singapore. In such a system, devices that had been in close contact are detected. If a user tests positive for the coronavirus, the application enables potentially infected individuals to be informed about further instructions [20]. In addition, "CA NOTIFY" is a Bluetooth-based contact tracing smartphone application that was developed in California, United States. Although CA NOTIFY claims that it will not share any information about individuals, this system still needs an application to be installed on smart devices and Bluetooth to be turned on [21]. The other countries that developed Bluetooth-based contact tracing applications are Austria and Australia [20]. Furthermore, Altuwaiyan et al. [16] introduced an efficient privacy-preserving contact tracing system to detect infection, which is based on short-range wireless proximity technology and performs contact tracing to provide fine-grained information about human-to-human interaction information. This system uses both WiFi and Bluetooth to receive signals and convert them into distance, which allows the system to detect the users' contacts. Despite the system's accuracy, this framework needs to use WiFi and Bluetooth data simultaneously, which might not be cost-effective and can deplete batteries. More information about the application of COVID-19 contact tracing in different countries can be obtained from the study of Ahmed et al. [22].
Despite the significance of the developed, automated, contact tracing systems, two main challenges have not yet been addressed: preserving privacy and the need for installing applications on smart devices. As it was previously mentioned, most of the current contact tracing systems work based on smartphone applications, which require installation on users' smartphones and need further information from users [23]. Under such a circumstance, these systems cannot completely protect users' privacy [24]. Additionally, the need for interactions between smartphone applications in different contact tracing systems (e.g., Bluetooth-based contact tracing systems) may deplete the smart device's battery. Therefore, this study aims to address these challenges by introducing a passive contact tracing system based on WiFi indoor positioning. Applying a WiFi positioning approach to developing a contact tracing system would eliminate the need for required smartphone applications in contact tracing and protect users' privacy, as it does not require the users' identification information.

WiFi Positioning Systems
In recent years, the WiFi positioning system (WPS) has found more and more applications in many spheres, including the built environment. It is used not only outside, but also inside buildings where GPS navigation cannot work effectively due to signal blocking. The WiFi-based indoor positioning system defines coordinates using WiFi access points (APs) to transmit certain data. Using the received signal strength (RSS) and media access control (MAC) address of WiFi-enabled devices, the system can precisely define the current location of the user's device. At present, almost all people carry smart devices, especially smartphones, which can easily connect to WiFi systems, making WPS a reliable method for finding and tracking indoor positions in the built environment. Indoor WiFi positioning is becoming more popular nowadays because of its cost-effectiveness [25].

WPS Techniques
Several techniques have been used to develop WPS to estimate indoor positions. There are two categories of WPS techniques, active and passive, according to whether the user carries specific smart devices. The active positioning system, which is the most commonly used WPS, refers to when the user needs to carry mobile devices to actively search and collect nearby APs signals. Accordingly, the signals obtained from APs can be collected and directly transmitted to a server, which can find the users' positions using different positioning algorithms. In contrast, the passive positioning system refers to when the user does not need to carry any equipment, but the signal transmitter and receiver need to be deployed. In this case, there is a positioning area, and if the user enters this area, he/she will affect the propagation of the signal. Consequently, the receiver receives different signals when the user moves from one point to another, and it can find the user's positions based on the signal fluctuation [26]. Although the passive positioning system can be effectively used on many, specific occasions, such as the real-time positioning of criminal individuals, this study only focused on the active positioning system because of its application in indoor positioning and its potential for developing a contact tracing system.
There are two types of active positioning systems: (1) range-based localization technique and (2) fingerprinting technique. The range-based localization technique utilizes RSS data between a smart device and an AP to estimate the position based on lateration and angulation methods [26]. The main idea of lateration estimation is to calculate the distance between the smartphone and AP using geometry and signal measurement information, such as the time of arrival (TOA), time difference of arrival (TDOA), and angle of arrival (AOA), of the incoming signals from Aps [27]. To calculate users' positions via this technique, three distance measurements are required. However, this technique suffers from non-line-of-sight (NLOS) multipath signals because of the presence of walls and furniture, and also the movements of people.
The fingerprinting technique uses RSS data obtained from multiple APs in two phases: offline and online. In the offline phase, a rectangular set of grid points is assigned to the entire area of interest, and a site survey is conducted by recording the RSS from at least three APs at each point, which is then stored in a database named the radio map. Subsequently, in the online phase, the smart device gathers the RSS from the APs and sends it to the server to compare the predefined fingerprint of the offline phase with the RSS data in the online phase in order to estimate the location on the grid map [27]. Different machine learning algorithms are suggested and used in order to compare offline and online data, such as k-nearest neighbors (KNNs) [28], weighted KNN [29], neural network [30], recurrent neural network (RNN) [31], and Naïve Bayes [32], among others. The positioning algorithm and the quality of observations can impact the performance of these positioning techniques. Because of the limitation of single WiFi methods and to enhance the accuracy of positioning estimations, many hybrid methods have been introduced in fingerprinting techniques. In hybrid Sustainability 2022, 14, 10255 6 of 21 methods, the fingerprinting technique is combined with proximity-based technologies, such as Bluetooth, to improve the accuracy. For example, Xiang et al. [33] used different sensors and combined WiFi with temperature, humidity, and light data to enhance positioning accuracy. Moreover, Antevski et al. [34] combined WiFi with Bluetooth to estimate the positions of study groups in smart libraries. In addition, Zirari et al. [35] proposed a combined positioning algorithm that works based on WiFi and GPS. The major advantage of the fingerprinting technique is its resistance to multipath signals compared to lateration and angulation. Conversely, the major disadvantage is the time required to set up and maintain the training fingerprint database [36].

The Accuracy of Indoor Positioning Technologies
Despite the advantages and disadvantages of each WPS technique, the application of each system significantly depends on the accuracy of estimating positions. Several studies have compared and enhanced current WPS technologies' accuracy in recent years. Table 1 summarizes the measured accuracy of different WPS techniques highlighted in the recent literature. It has to be mentioned that studies use two main ways to report the accuracy results: (1) indicating the average distance that their system can work with negligible errors, and (2) indicating the percentage of correct predictions. As Table 1 illustrates, fingerprinting-based WPS presents more accurate results than other WPS techniques because they can reduce the errors of signal disruption due to the walls and furniture in an indoor environment. Furthermore, WiFi technology takes advantage of other technologies because it not only does not need any additional application on smart devices (such as Bluetooth technology) or hardware (such as RFID tags in RFID technology), but it also does not consume too much battery life of smart devices (such as Bluetooth technology). In addition, the accuracy of each fingerprinting-based WPS depends on the machine learning algorithm that they used. Therefore, different fingerprinting-based studies obtain results with different accuracies based on the calculation algorithm used. As Table 1 illustrates, the fingerprinting technique could reach a positioning accuracy of 1-2 m in indoor environments. According to the European Centre for Disease Prevention and Control [20], the distance accuracy of 2 to 3 m could be an appropriate measure for developing a reliable contact tracing system in the case of COVID-19, making the fingerprinting technique a candidate tool.

Application of WPS in the Built Environment
The WiFi positioning system has been used in the built environment for several purposes, including counting the number of occupants, energy efficiency, tracking an asset, measuring the occupants' stay times, and emergency evacuation.
Counting the number of occupants is essential for building monitoring and management. The use of WPS for counting the number of occupants can help control people in specific places and monitor their entry and exit [30,[50][51][52][53]. In addition, WPS can be a good alternative for counting people inside the building, such as shopping centers, airports, and hospitals [54]. In this case, previous studies used different sensors, such as cameras, to accurately validate and develop their WiFi-based occupant-counting systems in indoor environments [55]. Increasing the enrollment of students in schools and universities requires an accurate monitoring of the presence of students in classrooms, which cannot be effective using traditional methods, such as manual counting. Therefore, another application of WPS is to detect and monitor the presence of students in classrooms [56].
Moreover, detecting occupants in buildings can help to monitor building energy consumption with more ingenious methods. In this regard, WPS can help reduce building energy consumption based on occupants' locations by providing a smart HVAC control [12,57] or smart lighting control [13]. Tracking an asset is another goal of WPS in an indoor environment, where GPS cannot work efficiently. Therefore, WPS can be an efficient substitute for GPS in tracking objects [36] or humans [34] in indoor environments [30]. Furthermore, labor tracking is one of the critical parts of construction sites. In this case, WPS can help track laborers and even assets in construction sites [58]. Tracking old adults who have health problems and need help is another use of WPS, which allows people to monitor them and track their movements [59]. Once the location of an asset is detected, the stay time duration can also be measured. Stay time duration can not only be useful in monitoring crowds in public places (such as libraries), but can also help to enhance the efficiency of employees in their office. Another application of WPS is in smart building control. As many buildings have experienced a transition to smart control from traditional monitoring based on the improvement of the IoT, WPS can help such buildings to be monitored in this new way. For instance, WPS can be used to smartly monitor HVAC systems to minimize the energy consumption of buildings [60]. In addition, WPS can also provide a valuable system to enhance evacuation management in buildings by detecting the occupants' positions in the case of an emergency evacuation [61,62]. Additionally, other studies showed that the combination of smart systems, such as WPS, with traditional systems, such as pedestrian dead reckoning (PDR), would be more effective during severe disasters when only a few APs are available [63]. Using WPS without knowing the exact location of APs is another application of WPS in the evacuation that was investigated by Ohta et al. [64].
University campuses and large office buildings widely use the application of WPS. Such buildings usually contain facilities with central WiFi infrastructures and a high number of APs distributed in the buildings. Therefore, WPS has been widely used in university campuses and office buildings for different purposes. Table 2 summarizes the recent studies that used WPS in a university campus.

A Conceptual Framework for Contact Tracing
Although proximity-based technologies have displayed promise in developing contact tracing systems in an indoor environment, they include their limitations (e.g., preserving privacy and the need for installing applications on smart devices). The development of WiFi infrastructures in commercial buildings allows WPS to be used in fighting against contagious diseases by developing a contact tracing system that addresses such limitations. The particular use of such a tracing system is in academic facilities and office workplaces, where the same users use the building regularly. In the proposed contact tracing system, WPS is used to measure occupants' locations and stay time durations passively using their WiFi-enabled smart devices and without using any application. The system only needs the user to be connected to the WiFi system, which is common in such commercial buildings. It should be noted that this study focused on active WiFi positioning techniques, and the term passive, used to describe the contact tracing system, is not related to any WiFi positioning technique.
This section describes the proposed conceptual framework to use indoor WiFi positioning in developing a passive contact tracing system for commercial buildings, which is based on an initial model presented in [67]. Figure 1 illustrates the three main phases of establishing such a system: phase 1 to set up and configure WPS for the purpose of contact tracing; phase 2 to design an algorithm for storing data and tracing dangerous contacts using WPS output; and phase 3 to develop a notification system to send the required instructions to potentially infected users without identifying them. In this section, phases and related steps to achieve the goal of each phase are provided.

Phase 1: WPS Setup and Configuration
The first phase of the framework was to set up an indoor WiFi positioning system in the building. The fingerprinting technique, one of the most advanced WPS technologies, can measure the user's position with just the presence of several APs and a reliable calculating algorithm. In order to make sure that APs cover all the effective areas of the building, various techniques can be used to find the optimal number of APs and their correct places. For example, the genetic algorithm-based model developed by He et al. [68] was used to estimate the optimal number of APs in an indoor space according to the genetic algorithm. They indicated that when the size of the target area increased, the number of APs had to be increased (as an example, if 3 APs provide enough accuracy in an 8 m × 16 m area, a 32 m × 32 m area requires at least 8 APs to obtain targeted accuracy). In addition, the Sustainability 2022, 14, 10255 9 of 21 optimization model developed by Zhao et al. [69] was also applied to estimate the optimum position of the APs for accurate WiFi-based positioning. They indicated that APs had to be placed around the site in a "zigzag" pattern rather than a straight line, if researchers needed to obtain the best performance from such a system. Moreover, Farkas et al. [70] introduced a simulated annealing-based method to achieve a good approximation of the optimal solution for obtaining APs' locations. This algorithm assisted in placing the APs to perceive the signal of at least three reference APs everywhere in the given indoor territory. In the case of retrofitting a building with an existing WiFi infrastructure to implement the proposed framework, close attention should be paid to the APs and their positions in order to optimize the accuracy of the results. The optimum number and location of APs can be observed in [69,70].

Phase 1: WPS Setup and Configuration
The first phase of the framework was to set up an indoor WiFi positioning system in the building. The fingerprinting technique, one of the most advanced WPS technologies, can measure the user's position with just the presence of several APs and a reliable calculating algorithm. In order to make sure that APs cover all the effective areas of the building, various techniques can be used to find the optimal number of APs and their correct places. For example, the genetic algorithm-based model developed by He et al. [68] was used to estimate the optimal number of APs in an indoor space according to the genetic algorithm. They indicated that when the size of the target area increased, the number of APs had to be increased (as an example, if 3 APs provide enough accuracy in an 8 m × 16 m area, a 32 m × 32 m area requires at least 8 APs to obtain targeted accuracy). In addition, the optimization model developed by Zhao et al. [69] was also applied to estimate the optimum position of the APs for accurate WiFi-based positioning. They indicated that APs had to be placed around the site in a "zigzag" pattern rather than a straight line, if researchers needed to obtain the best performance from such a system. Moreover, Farkas et al. [70] introduced a simulated annealing-based method to achieve a good approximation of the optimal solution for obtaining APs' locations. This algorithm assisted in placing the APs to perceive the signal of at least three reference APs everywhere in the given indoor territory. In the case of retrofitting a building with an existing WiFi infrastructure to implement the proposed framework, close attention should be paid to the APs and their After the optimal number of APs and their optimal locations are determined on the building for WiFi positioning, a fingerprinting-based positioning technique can be implemented to record the position of WiFi-enabled devices in the area. In the offline phase, some reference points (RPs) should be defined in the area. As Figure 2 shows, the position of each RP has to be defined (on the x-y axes), and the intensity of RSS data between each RP and AP should be measured. The RPs' positions and RSS data intensity are used to develop a radio map (dataset) at the end of the offline phase, which is used in the online phase to measure the users' positions. The radio map is an essential part of this system that needs to be implemented before the system is online. This is an essential part since, without a radio map, the accuracy of the system in determining the real-time positions will be questioned. Such a requirement may significantly impact the scalability of the proposed framework. However, creating a radio map is a one-time process for each indoor environment, making this system preferable in smaller-scale environments. When RSS data are received from an unknown user in the online phase, the system can use an appropriate algorithm to compare the radio map data with the unknown user data to estimate the best match position. As previously mentioned, algorithms, such as WDCI-KNN [37], neural network [30], kJBD, and KLMvG [27], can provide enough accuracy to be used in contact tracing systems. The system can accurately estimate the users' positions, based on the smart device's unique MAC address in the online phase. without a radio map, the accuracy of the system in determining the real-time positions will be questioned. Such a requirement may significantly impact the scalability of the proposed framework. However, creating a radio map is a one-time process for each indoor environment, making this system preferable in smaller-scale environments. When RSS data are received from an unknown user in the online phase, the system can use an appropriate algorithm to compare the radio map data with the unknown user data to estimate the best match position. As previously mentioned, algorithms, such as WDCI-KNN [37], neural network [30], kJBD, and KLMvG [27], can provide enough accuracy to be used in contact tracing systems. The system can accurately estimate the users' positions, based on the smart device's unique MAC address in the online phase. The use of unique MAC addresses to highlight the users can protect their privacy due to the fact that no identifying information is gathered. These MAC addresses are used later to inform the users about their dangerous contacts. If implemented correctly, such a system can estimate the position of each smart device within the building with an accuracy of less than 1 m.
After successfully installing the WiFi positioning system setup and implementing the radio map, the radio map dataset (which consists of RSS data of each reference point) and real-time RSS data of each MAC address (which belongs to each smart device) are used as inputs for this phase. Then the system applies the chosen algorithm and provides the realtime position of each MAC address. Thus, the output of this phase is the real-time position of each MAC address.
The main limitation of this system is a new technology called MAC randomization. MAC randomization is a process that hides the MAC address of a device by generating and assigning an artificial random MAC address in its place whenever the device tries to connect to an AP. MAC randomization helps to ensure the privacy of mobile devices by concealing the original MAC address, making it significantly harder to track a device based on its MAC address. This feature has been implemented on iPhones with iOS 14 or later, and may also be implemented in Android devices soon. However, this feature can be manually disabled by users on any device. In this regard, Figure 3 indicates the process of detecting the real-time positions. The use of unique MAC addresses to highlight the users can protect their privacy due to the fact that no identifying information is gathered. These MAC addresses are used later to inform the users about their dangerous contacts. If implemented correctly, such a system can estimate the position of each smart device within the building with an accuracy of less than 1 m.
After successfully installing the WiFi positioning system setup and implementing the radio map, the radio map dataset (which consists of RSS data of each reference point) and real-time RSS data of each MAC address (which belongs to each smart device) are used as inputs for this phase. Then the system applies the chosen algorithm and provides the real-time position of each MAC address. Thus, the output of this phase is the real-time position of each MAC address.
The main limitation of this system is a new technology called MAC randomization. MAC randomization is a process that hides the MAC address of a device by generating and assigning an artificial random MAC address in its place whenever the device tries to connect to an AP. MAC randomization helps to ensure the privacy of mobile devices by concealing the original MAC address, making it significantly harder to track a device based on its MAC address. This feature has been implemented on iPhones with iOS 14 or later, and may also be implemented in Android devices soon. However, this feature can be manually disabled by users on any device. In this regard, Figure 3 indicates the process of detecting the real-time positions.

Phase 2: Data Storage and Contact Tracing
In the second phase, the positioning data are stored, and the users' contacts are extracted. In this regard, to define a reliable contact tracing process, it is essential to systematically collect and store the required data. High-risk contact with a confirmed infected individual, which can cause another person to become a suspected COVID-19 case, is considered to take at least 15 min to detect in a specific zone [20]. Moreover, a confirmed,

Phase 2: Data Storage and Contact Tracing
In the second phase, the positioning data are stored, and the users' contacts are extracted. In this regard, to define a reliable contact tracing process, it is essential to systematically collect and store the required data. High-risk contact with a confirmed infected individual, which can cause another person to become a suspected COVID-19 case, is considered to take at least 15 min to detect in a specific zone [20]. Moreover, a confirmed, infected individual has the potential to infect other individuals approximately five days before the symptoms have emerged, which makes a five-day quarantine necessary [4]. In order to locate the suspected COVID-19 cases, different space zones can be defined in the building layout. A zone is an indoor space where confirmed, infected users have the potential to contact other users and make them suspected COVID-19 cases (e.g., classrooms, offices, and libraries). Once the zones are defined in the buildings, users' high-risk contacts can be collected based on the positions and duration of the contacts. These data can be stored by users' unique MAC addresses in a real-time dataset and can be eliminated after every five days for privacy issues and to avoid creating large datasets. It should be mentioned that some users may have more than one WiFi-enabled device, which can create some limitations for such a system [30], because the system considers these additional devices as unique users and register their data to the system. However, in the proposed contact tracing system, a user's multiple smart devices would not impact the outcome since each device can be assumed to be a separate user who regularly contacts others. The system tries to send notifications to all devices in a positive-COVID-19 case.
A search algorithm was developed to convert the positioning information into a contact tracing dataset. The algorithm, presented in Figure 4, is able to find high-risk contacts to generate a network of MAC addresses. First, it takes advantage of positioning data to locate all the high-risk contacts. Subsequently, if any user is diagnosed or shows any symptoms of COVID-19 on a specific date (i.e., tested positive for COVID-19), the system is able to detect every high-risk contact in the past five days. The system can provide high-risk contacts of a specific MAC address, the location of contacts, and the date and time of contact. The suspected COVID-19 cases are to be identified by the end of this procedure. In other words, the system receives each MAC address position (based on its date and time) and also the updated list of confirmed COVID-19 cases (based on the MAC addresses) as inputs. Subsequently, it applies the 15 min constraint to the contacts. Therefore, the outputs of the system at the end of this phase are the high-risk contacts of a specific MAC address, the location of contacts, and the date and time of contact.

Phase 3: Users Notifications and Instructions
In the third phase, a process was developed to notify suspected COVID-19 cases when they reconnected to the WiFi system. The proposed contact tracing system identifies each user by his unique MAC address. The system is also able to let the users take the COVID-19 test voluntarily, using only their MAC addresses as their identification code instead of their name or other information. According to the second phase, whenever a user's COVID-19 test is positive, their device's unique MAC address can be determined. Then, using the created contacts network, their high-risk contacts in the past five days can be obtained and marked as suspected COVID-19 cases. Finally, since it is possible to send messages to WiFi clients who are connected to a specific WiFi network [71], once the suspected COVID-19 cases are reconnected to the WiFi system, notifications can be sent to their devices using their MAC addresses to inform them about the risk involved and provide them with guidelines for starting the self-quarantine procedure without identifying them. This process can be performed using emergency alert systems, such as wireless emergency alerts (WEAs) [72], which governments have used during special disasters (such as floods or storms) to send notifications to people. Therefore, high-risk MAC addresses can be targeted, and emergency notifications can be sent to them by such an alert system. Thus, the final output of the system is notifying the suspected COVID-19 cases

Phase 3: Users Notifications and Instructions
In the third phase, a process was developed to notify suspected COVID-19 cases when they reconnected to the WiFi system. The proposed contact tracing system identifies each user by his unique MAC address. The system is also able to let the users take the COVID-19 test voluntarily, using only their MAC addresses as their identification code instead of their name or other information. According to the second phase, whenever a user's COVID-19 test is positive, their device's unique MAC address can be determined. Then, using the created contacts network, their high-risk contacts in the past five days can be obtained and marked as suspected COVID-19 cases. Finally, since it is possible to send messages to WiFi clients who are connected to a specific WiFi network [71], once the suspected COVID-19 cases are reconnected to the WiFi system, notifications can be sent to their devices using their MAC addresses to inform them about the risk involved and provide them with guidelines for starting the self-quarantine procedure without identifying them. This process can be performed using emergency alert systems, such as wireless emergency alerts (WEAs) [72], which governments have used during special disasters (such as floods or storms) to send notifications to people. Therefore, high-risk MAC addresses can be targeted, and emergency notifications can be sent to them by such an alert system. Thus, the final output of the system is notifying the suspected COVID-19 cases and sending them the required procedures for self-quarantine. In this regard, Figure 5 presents the process of sending notifications. emergency alerts (WEAs) [72], which governments have used during special disasters (such as floods or storms) to send notifications to people. Therefore, high-risk MAC addresses can be targeted, and emergency notifications can be sent to them by such an alert system. Thus, the final output of the system is notifying the suspected COVID-19 cases and sending them the required procedures for self-quarantine. In this regard, Figure 5 presents the process of sending notifications.
It should be noted that the entire procedure, from locating occupants' positions to notifying the individuals exposed to COVID-19, is based on smart devices' unique MAC addresses to preserve the users' privacy. The system's privacy rules ensure that the users would neither be subjected to further investigations related to COVID-19, nor would they be forced to endure mandatory self-quarantine by the system. The designed procedure can not only prevent the spread of the COVID-19 disease, but can also inform the users in a timely manner to take appropriate actions individually and collectively.

Case Study
A simulated small-office layout was used in a case study to demonstrate the applicability of the proposed framework and investigate the role of such a system in reducing the number of infected cases in shared office spaces. The current case study focused on phase It should be noted that the entire procedure, from locating occupants' positions to notifying the individuals exposed to COVID-19, is based on smart devices' unique MAC addresses to preserve the users' privacy. The system's privacy rules ensure that the users would neither be subjected to further investigations related to COVID-19, nor would they be forced to endure mandatory self-quarantine by the system. The designed procedure can not only prevent the spread of the COVID-19 disease, but can also inform the users in a timely manner to take appropriate actions individually and collectively.

Case Study
A simulated small-office layout was used in a case study to demonstrate the applicability of the proposed framework and investigate the role of such a system in reducing the number of infected cases in shared office spaces. The current case study focused on phase 2 of the proposed framework to illustrate how data storage and contact tracing can be applied in an office environment.
An agent-based occupancy simulator was used to model the occupancy schedule and location of occupants for the office layout, similar to a WiFi positioning system. The simulator determined the location of each occupant in each time period using a Markov chain model [73]. This occupancy simulator tool is a Web application, sponsored by the Department of Energy, available for public use on the Lawrence Berkeley National Laboratory website. The simulator obtains high-level inputs of occupants, spaces, and events and then simulates occupant movement and generates occupant schedules for each area. The generated schedules capture the diversity and stochastic nature of occupant activities. These schedules (that are very similar to the output of a WPS) can be downloaded and used for different purposes. The detailed algorithms used in this simulator are introduced in [74], and a performance evaluation of the model is presented in [75]. In order to simulate the location of each occupant in the example of a small-office layout, the number of occupants, spaces (zones), and events were defined in the simulator to model the presence of occupants in the building.
The example of a small-office case is a 960 square meter (≈10,000 square foot) building, including twenty private offices (700 m 2 ), two meeting rooms (100 m 2 ), two auxiliary rooms (60 m 2 ), one lobby (50 m 2 ), and one corridor (50 m 2 ). Twenty people were assumed to occupy this office building, including one manager (5%), seven administrators (35%), and twelve regular staff (60%). A schematic view of the office layout is presented in Figure 6.
The example of a small-office case is a 960 square meter (≈10,000 square foot) building, including twenty private offices (700 m 2 ), two meeting rooms (100 m 2 ), two auxiliary rooms (60 m 2 ), one lobby (50 m 2 ), and one corridor (50 m 2 ). Twenty people were assumed to occupy this office building, including one manager (5%), seven administrators (35%), and twelve regular staff (60%). A schematic view of the office layout is presented in Figure  6. The average working period for office workers is 9 h per day, including 1 h for a lunch break [76]. Following the assumption of the case study presented in [77], we assumed the work hours of 8:30 a.m. to 5:30 p.m. during weekdays (with a variation of 30 min) for each occupant. Moreover, we assumed a 60 min lunch break (with a variation of 15 min) starting at around noon.
The only event defined in the case study is the meeting events occurring in two different meeting rooms. In the first meeting room, the meetings will be held on three days of the week (i.e., Monday, Wednesday, and Friday), with the probability of 1 to 4 meetings per day, with 3 to 8 people randomly participating in each meeting. The durations of the meetings are modeled probabilistically: 20% of meetings are 30 min long, 60% of meetings are 60 min long, 15% of meetings are 90 min long, and 5% of meetings are 120 min long. The average working period for office workers is 9 h per day, including 1 h for a lunch break [76]. Following the assumption of the case study presented in [77], we assumed the work hours of 8:30 a.m. to 5:30 p.m. during weekdays (with a variation of 30 min) for each occupant. Moreover, we assumed a 60 min lunch break (with a variation of 15 min) starting at around noon.
The only event defined in the case study is the meeting events occurring in two different meeting rooms. In the first meeting room, the meetings will be held on three days of the week (i.e., Monday, Wednesday, and Friday), with the probability of 1 to 4 meetings per day, with 3 to 8 people randomly participating in each meeting. The durations of the meetings are modeled probabilistically: 20% of meetings are 30 min long, 60% of meetings are 60 min long, 15% of meetings are 90 min long, and 5% of meetings are 120 min long. In the second meeting room, the meetings will be held on two days of the week (i.e., Monday and Thursday), with the probability of 1 to 3 meetings per day, with 3 to 5 people randomly participating in each meeting. The durations of the meetings are modeled probabilistically: 40% of meetings are 30 min long, 40% of meetings are 60 min long, and 20% of meetings are 90 min long.
In addition, each occupant spends some time in different locations based on a probabilistic Markov matrix as follows: 60% of the time in his/her own office, 20% of the time in other offices, 10% of the time in meeting rooms, 5% of the time in auxiliary rooms, and 5% of the time in other places (e.g., corridor). In total, 26 zones are defined in the office building (i.e., private offices, meeting rooms, auxiliary rooms, lobby, and corridor) as well as the outside of the building.

Results and Discussion
After defining all the inputs, the simulator was used to model a sample location of occupants in 3 whole weeks (from 1 to 22 November 2021), including 15 working days and 6 weekends. The simulation was set to time intervals of 5 min, so that the location of each occupant in the building could be simulated every 5 min. Such a simulation is very similar to the outcome of an indoor positioning system, where the location of occupants can be stored in a specific time-step (assuming there is one and only one smart device associated with each occupant). The simulated occupancy schedule of the building for a specific day is presented in Figure 7. and 6 weekends. The simulation was set to time intervals of 5 min, so that the location of each occupant in the building could be simulated every 5 min. Such a simulation is very similar to the outcome of an indoor positioning system, where the location of occupants can be stored in a specific time-step (assuming there is one and only one smart device associated with each occupant). The simulated occupancy schedule of the building for a specific day is presented in Figure 7. We used the example office layout to implement the developed WiFi-based passive contact tracing system in the case of SARS-CoV-2 transmission. It was assumed that a WPS was already implemented in the office and working correctly by collecting the position of each occupant in time intervals of 5 min. It was also assumed that each occupant carried only one WiFi-enabled device (although such an assumption might not have been accurate, it had no impact on the final outcome). The identity of the occupants was not collected, but the smart device's MAC address was used to identify each individual in the office (each occupant was assigned an ID that could represent the MAC address of his/her smart device). These data were collected upon their entrance into the building, and it were collected every 5 min until they left the office. To illustrate the application of the proposed contact tracing system, we used the simulator results as the WPS output. Therefore, the model implementation only focused on the validation of phase 2 of the proposed framework.
For the example office case, it was assumed that each of the 26 zones in the office layout were high-risk zones. In this regard, we considered four scenarios (with random occupants) for testing the contact tracing model in the example office case as follows: We used the example office layout to implement the developed WiFi-based passive contact tracing system in the case of SARS-CoV-2 transmission. It was assumed that a WPS was already implemented in the office and working correctly by collecting the position of each occupant in time intervals of 5 min. It was also assumed that each occupant carried only one WiFi-enabled device (although such an assumption might not have been accurate, it had no impact on the final outcome). The identity of the occupants was not collected, but the smart device's MAC address was used to identify each individual in the office (each occupant was assigned an ID that could represent the MAC address of his/her smart device). These data were collected upon their entrance into the building, and it were collected every 5 min until they left the office. To illustrate the application of the proposed contact tracing system, we used the simulator results as the WPS output. Therefore, the model implementation only focused on the validation of phase 2 of the proposed framework.
For the example office case, it was assumed that each of the 26 zones in the office layout were high-risk zones. In this regard, we considered four scenarios (with random occupants) for testing the contact tracing model in the example office case as follows: • In each scenario, the confirmed, infected individual ID was acquired, and then the proposed model was implemented on the simulated WPS data to identify the high-risk contacts (i.e., the ID of potentially infected individuals as well as the time and location of dangerous contacts) for further instruction. Figures 8-11 present the results of the proposed framework in each scenario. The results show that all high-risk contacts occurred in the meeting rooms. This was because the meeting rooms were active on four days of the week, and at least one meeting occurred each day with the participation of at least three occupants. Moreover, the minimum duration of each meeting was 30 min, which meant that occupants who were in each meeting were involved in high-risk contact. Furthermore, the occupants rarely met each other for 15 min or more in their private offices. results show that all high-risk contacts occurred in the meeting rooms. This was because the meeting rooms were active on four days of the week, and at least one meeting occurred each day with the participation of at least three occupants. Moreover, the minimum duration of each meeting was 30 min, which meant that occupants who were in each meeting were involved in high-risk contact. Furthermore, the occupants rarely met each other for 15 min or more in their private offices.   the meeting rooms were active on four days of the week, and at least one meeting occurred each day with the participation of at least three occupants. Moreover, the minimum duration of each meeting was 30 min, which meant that occupants who were in each meeting were involved in high-risk contact. Furthermore, the occupants rarely met each other for 15 min or more in their private offices.       As the results show, in scenario 1, the occupant with ID 06 has the potential to infect eight other individuals with nine high-risk contacts. On the other hand, in scenario 2, the two confirmed infected occupants have five high-risk contacts, and they could infect four individuals. The first two scenarios contain two messages. First, the potential to infect other individuals varies based on the confirmed case behaviors. For example, an occupant with ID 06 could infect eight other individuals during five days, while an occupant with As the results show, in scenario 1, the occupant with ID 06 has the potential to infect eight other individuals with nine high-risk contacts. On the other hand, in scenario 2, the two confirmed infected occupants have five high-risk contacts, and they could infect four individuals. The first two scenarios contain two messages. First, the potential to infect other individuals varies based on the confirmed case behaviors. For example, an occupant with ID 06 could infect eight other individuals during five days, while an occupant with ID 17 could only infect one person. This could have been because of the different responsibilities of the occupants in an office. For example, it is possible that the occupant with ID 06 needed to participate in more meetings and visit more people based on his or her responsibilities, and therefore this occupant could infect more individuals. Second, all confirmed infected occupants in these two scenarios could infect at least one individual. Thus, if potentially infected occupants are not detected, and this chain continues, many occupants can be in danger of infection in the future. In scenario 3, the three confirmed infected occupants were involved in 20 high-risk-contact cases, and they could infect 13 individuals. In scenario 4, the four confirmed cases had a total number of 33 high-risk contacts, and they could infect 13 individuals. Considering the four scenarios' results, it can be determined that all of the confirmed infected occupants have the potential to infect at least one individual, and it can be extended to more than 12 people based on the occupants' responsibilities and the rate of their contact with others. In this case, the best scenario occurred in scenario 2, where a confirmed infected case could infect just one person. However, even if this scenario occurred for all of the other potentially infected occupants in all of the four scenarios, the majority of occupants could become infected in less than one week. Thus, a reliable contact tracing system can prevent the transmission of the disease by accurately detecting the potentially infected occupants. Moreover, based on the results, the occupants who were in meetings more frequently than others during weekdays were not only in greater danger of infection, but they also had the potential to infect more occupants if they were infected. The results also show that if the number of confirmed infected COVID-19 cases increases from one to three, these confirmed cases have the potential to infect the majority of occupants in a small office. It can be observed that a reliable contact tracing system can play a crucial role in notifying suspected COVID-19 individuals and breaking the chain of coronavirus transmission in such an environment.

Conclusions
The current study aimed to introduce a conceptual, passive, contact tracing system for commercial buildings using indoor WiFi positioning, and investigate its role in reducing the number of infected cases in shared public environments. The proposed system can address the current challenges of developed, automated, contact tracing systems by (1) replacing Bluetooth-proximity technology that can deplete smart device batteries by indoor WiFi positioning, (2) eliminating the need for installing applications on smart devices by passively tracking the location of users' WiFi-enabled smart devices, and (3) preserving the users' privacy by working with the devices' unique MAC addresses instead of the users' identities. The main limitations of the proposed system were as follows: (1) it required the new iOS devices to manually turn off MAC randomization features, and (2) it considered a user's multiple smart devices as multiple users, which may result in not estimating the correct number of high-risk contacts. The system's accuracy also depended on the accuracy of the implemented WiFi positioning system in place. One potential advantage of the proposed system was that it could identify users with a high number of high-risk contacts each day and encourage them to take precautionary actions, such as testing.
Because of the lack of case studies, only phase 2 of the framework was tested in this study. The proposed model was implemented on a simulated small-office layout to demonstrate its applicability. The occupancy of the office was simulated using an agentbased occupancy simulator to model the occupancy schedule and location of occupants for the office layout, similar to a WiFi positioning system. Different scenarios were considered for testing the search algorithm to identify the high-risk contacts. The results show that the system can identify suspected individuals and break the chain of virus transmission in office workplaces.
Such tracing systems can be used in academic facilities and office workplaces, where (1) the WiFi infrastructure already exists and therefore implementing such a system could be cost-effective, and (2) the same users regularly use the facility, enabling the system to notify the users upon a confirmed case once they are back in the building and connected to the WiFi system. The developed system can benefit facility managers, business owners, policy makers, and authorities in assisting to find occupants' high-risk contacts and control the spread of SARS-CoV-2 or similar infectious diseases in commercial buildings, particularly university campuses and office buildings.
As a future research direction, the authors aim to perform a real case study by implementing the proposed system in a real-world office building. Such a real case study can help validate the model and investigate its feasibility in terms of costs and accuracy. Since such a system can detect the occupants' real-time contacts, it can also be used in several applications for building a smart office environment, such as smart occupant-centric building energy system control, emergency evacuation, and productivity tracking. Therefore, implementing such a system can be part of a whole package of building smart user management toward improving health, wellbeing, and productivity while reducing energy consumption. Furthermore, the improvements of the IoT has allowed for different parameters of buildings to be connected and monitored by simple applications. On the other hand, COVID-19 outbreaks highlighted the phrase "social distancing" and made it many people's primary concern, particularly in public places. In other words, people preferred to follow social distancing rules and not be in crowded places to avoid catching contagious diseases. Therefore, the results of such a contact tracing system can be developed further in smart devices applications to anonymously present the number of people in close contact in a public, indoor area. Accordingly, other people can check these data and choose to be in that place or not, based on their concerns about close contact.