Improved Control System based on PSO and ANN for Social Distancing for Patients with COVID-19

The World Health Organization has declared the COVID-19 pandemic, with most countries being affected by this virus both socially and economically. It thus became necessary to develop solutions to help monitor and control disease spread by controlling medical workers’ movements and warning them against approaching infected individuals in isolation rooms. This paper introduces a control system that uses improved particle swarm optimization (PSO), and artificial neural network (ANN) approaches to achieve social distancing. The distance between medical workers carrying mobile nodes and the beacon node (isolation room) was determined using the ZigBee wireless protocol’s received signal strength indicator (RSSI). Two path loss models were developed to determine the distance from patients with COVID-19: the first is a log-normal shading model (LNSM), and the second is a polynomial function (POL). The coefficient values of the POL model were controlled based on PSO to improve model performance. A random-nonlinear time variation controller-PSO (RNT-PSO) approach was developed to avoid the local minima of the conventional PSO. As a result, social distancing for COVID-19 can be accurately determined. The measured RSSI and the distance were used as ANN inputs, while three control signals (alarming, warning, and closing) were used as ANN outputs. The results revealed that the hybrid model between POL and RNT-PSO, called RNT-PSO-POL, improved the system’s performance by reducing the mean absolute error of distance to 1.433 m, compared to 1.777 m for the LNSM. The results show that the ANN achieves robust performance in terms of mean squared error.


I. INTRODUCTION
S INCE late 2019 COVID-19 has spread widely, disrupting people's lives, both socially and economically. The extensive spread is due, in part, to people's convergence [1]. Social distancing can reduce the risk of transmission of the COVID-19 disease [2]. Governments attempted to employ a range of social distancing measures during the COVID-19 epidemic, such as managing borders, limiting travel, closing clubs and bars, and advising society to keep a distance of 1.6 to 2 meters between them. However, keeping track of the quantity of virus spread and the limitations' effectiveness poses a challenge. People must go out for basic necessities such as health care, food, and other jobs and duties. As a result, numerous technology-based solutions [3], [4] and artificial intelligence-related research [5], [6] have attempted to assist the health and medical community in coping with COVID-19 challenges and successful social distancing strategies. These projects range from GPS-based patient tracking and localization to segmentation and crowd surveillance. Therefore, this paper aims to overcome some of these challenges by providing a control system that uses improved PSO and ANN approaches to achieve social distancing.
Thus, distancing between people has become crucial for controlling the spread of the disease, especially in terms of controlling the distance between medical workers and infected patients. Several approaches have been described in the literature. The most well-known is the received signal strength indicator (RSSI) used to determine the distance between isolation rooms and medical workers [7]- [10]. The RSSI decreases as a transmitter node moves away from a receiver node and vice versa [11]. Location accuracy can be improved using artificial intelligence methods such as fuzzy logic, neural networks, adaptive neuro-fuzzy inference systems, and particle swarm optimization (PSO) [12]. The RSSI approach is characterized by its simplicity and low cost, as it does not require additional hardware [13]; this approach was thus chosen to use in this study. Three factors affecting RSSI are reflection, diffraction, and scattering.
In a wireless sensor network, the difference in the strength of the transmitted and received signals is expressed as the loss factor. Various methods can be used to describe the relationship between the RSSI and distance, of which the log-normal shadowing model (LNSM) is one of the most popular [14]. This technique was chosen in this study due to its simplicity and low cost [15].
Various previous studies have used the LNSM to investigate the relationship between the RSSI and distance [16]; however, these models are typically characterized by high error rates. An alternative approach is the path loss model, a type of polynomial function (POL) model that can be obtained using MATLAB curve fitting. Choosing suitable coefficients is expected to improve the performance of the proposed POL model. Thus, to improve distance estimation accuracy between medical workers and the beacon node (i.e., isolation room), the PSO approach is proposed to determine the optimum coefficients of the POL model. However, the issue of the solution being trapped in local minima remains a major drawback of PSO; thus, an improved approach is required.
In modern life, optimization is everywhere. Optimization is a method to find the best solution to problems that cannot be found by classical approaches [17]. The performance of an optimization algorithm is classified as good or bad based on an objective function, which is formulated based on the application of interest to describe the relationship between the parameters and constraints. In recent years, there has been increasing research interest in optimization algorithms inspired by the social behavior of insects or animals, known as swarm algorithms, and those based on Darwinian theory, known as evolutionary algorithms.
Numerous approaches have been identified and applied to optimization algorithms [18]. As the size of the problem increases, identifying the best solution becomes difficult. Optimization has been used in various domains, including engineering design, commerce, and internet routing. The key reasons for using optimization algorithms are their ease of use and the effective solutions provided by these approaches. Swarm intelligence algorithms address mathematical models from the perspective of the complex social behaviors of animals or insects. The main components of these algorithms are exploration and exploitation; exploration is the ability of the algorithm to explore the problem's search space, and exploitation is the algorithm's ability to determine the optimum or near-optimum solution [19].
Many algorithms have been described in the existing literature to address real-world problems, including PSO [20], ant colony optimization (ACO) [21], the harmony search algorithm (HSA) [22], and the artificial bee colony (ABC) approach [23]. PSO mimics the social behavior of fish or birds' movements. The ACO technique is inspired by the searching mechanism of the ants as they seek the optimum path between food and their colony. The ABC method represents the mechanism used by bees when searching for food. Finally, the HSA technique mimics the behavior of a musician as they search for better harmony. However, the key drawback of all these algorithms is the issue of the solution becoming trapped in local minima. Therefore, to address this limitation, many alternative algorithms have been introduced, including the gravitational search algorithm (GSA) [24], cuckoo search algorithm (CSA) [25], bat search algorithm (BSA) [26], differential search algorithm (DSA) [27], and lightning search algorithm (LSA) [28]. The GSA is based on the law of gravity and mass interactions; in this algorithm, the populations are simulated as a collection of interconnected masses based on Newtonian gravity laws. The CSA is inspired by the lifestyle of cuckoo birds, specifically, their egg-laying behavior. The DSA mimics the social behavior involved in the migration of different organisms when searching for food and resources. The LSA technique was inspired by the natural phenomenon of lightning; in this approach, the populations are proposed based on step leader propagation.
However, not all optimization algorithms provide superior solutions for all engineering problems. Accordingly, new algorithms must be introduced in addition to continued efforts to improve existing algorithms. This study proposes a random-nonlinear time variation controller (RNT-PSO) approach. The RNT-PSO is a new concept-based technique formulated to solve single and multimodal optimization problems. Therefore, the utilization of the RNT approach is expected to improve the PSO's performance. The system is modeled in MATLAB to demonstrate the performance of the proposed algorithm. The RNT-PSO is used to improve the performance of the PLO model. Finally, the developed ANN is used as a control system to provide alarms, warnings, and closing control signals. The key contributions of this study can be summarized as follows: • The LNSM estimates the distance between medical workers and isolation rooms. • RNT is proposed as a new concept to escape from local minima in conventional PSO. • The proposed RNT-PSO approach is compared with related works. • A path loss model is proposed using MATLAB curve fitting. • The proposed POL model is hybridized with the improved PSO (RNT-PSO) to improve the distance estimation accuracy between medical workers and isolation rooms. • Statistical analysis based on the mean absolute error is used to compare the proposed model with related studies. • The ANN is proposed as a control system to provide three control signals, i.e., alarming, warning, and closing.
This paper includes seven sections. Section II describes the related works; the proposed social distancing system has been described in section III. Section IV describes the proposed RNT-PSO method. Section V contains the RNT-PSO-POL algorithm, and the discussion of results has been presented in section VI. Finally, the conclusion has been mentioned in section VII.

II. RELATED WORKS
Various methods have been described in the existing literature to measure the distance between mobile nodes and beacons. In [29], the distance was estimated based on ZigBee modules. This study computed the path loss model based on the trilateration method, with the RSSI signals for the mobile node evaluated using the MATLAB environment. However, the study's results showed instability in terms of their distance estimation. Mounir et al. introduced an improved flood or emergency system [30], where RSSI signals are collected based on the measurement method. Furthermore, the distance in this study is measured between the mobile nodes using two angles based on the trilateration method. The results showed how the signal strength decreases as the distance between the two nodes increases. The Kalman filter was used in [31] to estimate the distance between the access point and beacon, with this filter applied to eliminate noise. This study demonstrated a performance improvement of 8% when using the LNSM model. In [32], a proposed system was presented based on two Kalman filters to reduce the error. In this study, six beacons were utilized to calculate the distance based on RSSI signals, with an error of 1.77 m.
In [33], the authors suggested a method to estimate the distance between a user node and access point (AP) based on the RSSI. Ten APs and one user node were utilized in this system. The error was greater than 2 m when no AP was within 5 m, while the error was 0.7 m if three APs surrounded the user node. The authors in [34] proposed a system based on maximum likelihood localization. The concept of this system assumes that the error increases as distance increases. The error factor amount is a new concept outlined in this study. A hybrid system based on PSO and ANN was proposed for error reduction in [35]. The ANN was trained using the collected RSSI signals, with results showing the superiority of the proposed method over the traditional method. In [36], a path loss model was generated based on the collected RSSI signals. Different statistics, such as the moving average and median, filtered the collected RSSI signals. Two model environments were investigated (line-ofsight and non-line-of-sight), with two tests applied to both environments (Shapiro-Wilk and chi-square). The results demonstrate that the error is 1.09 m when the distance varies between 1 m and 9 m, while the error increases to 1.75 m if the distance is between 1 m and 20 m. In [37], the subject's location was determined based on the MinMax method. Four methods were used and evaluated in this study, namely, MinMax, ring overlapping circle RSSI, k-nearest neighbor (kNN), and maximum likelihood approaches. The MinMax method achieved the best results among these methods, with an error of 1.2 m.
Uradzinski et al. used the ZigBee fingerprint to evaluate the performance of their proposed positioning system [38]. The authors first established the fingerprint data and then estimated the mobile node's position based on RSSI signals. Furthermore, the performance of the proposed algorithm was improved using a filtering algorithm. Finally, the position was VOLUME 4, 2016 computed based on the Bayesian and weighted nearest algorithms. The average error value obtained in this study was equal to 0.81 m. Various fingerprint methods are described in [39], such as the nearest fingerprint (NF), affine Wasserstein combination (AWC), and k-nearest fingerprint combination (kNF) approaches. The results revealed that the average errors are 1.91 m and 1.908 m using the AWC and kNF methods. In [40], the authors used a quasi-structured method for location estimation. The system was conducted based on a multilayer perceptron network over an experimental area of 5 m × 5 m with 55 points. The average error was found to be 2 m.
Artificial intelligence approaches such as fuzzy logic, artificial neural networks, and optimization algorithms have been used in various applications. In [41], a hybrid system based on PSO and ANN enhanced localization system performance. The PSO-ANN method was compared with the backpropagation artificial neural network (BP-ANN) and kNN; superior results were achieved based on PSO-ANN, with an error of 1.893 m. In [42], a system based on PSO and the POL method was proposed in the context of Alzheimer's disease. The POL method was modeled based on collected RSSI signals. The PSO-POL approach was compared with the LNSM method, with an improvement of 20% in the mean absolute error achieved based on the PSO-PLO method. The mean absolute error (MAE) values were 1.6 m and 2 m based on the PSO-POL and LNSM approaches. In [43], location estimation was proposed based on the butterfly optimization algorithm. Different numbers of nodes were used in this study from 25 to 150 nodes. The performance of the butterfly optimization algorithm was compared with that of the PSO and firefly algorithms, with the butterfly optimization approach found to outperform other algorithms.
Estimating the distance with high accuracy between medical workers and those infected with Covid-19 is extremely important. Therefore, a new concept to escape from local minima in PSO is introduced based on random-nonlinear time variation (RNT-PSO). This concept aims to enhance the exploration and exploitation ability of conventional PSO by guiding the local and global swarms. Two models have been developed to estimate the distance: LNSM and POL. The POL model needs to be optimize. Thus the proposed RNT-PSO approach is used to improve the performance of the proposed POL model. Finally, a developed ANN is proposed to provide three control signals (alarming, warning, and closing) to establish social distancing between medical workers and isolation rooms.

III. THE PROPOSED SOCIAL DISTANCING SYSTEM
Implementation of the social distancing system between medical workers and isolation rooms begins first with the design of the wireless model, then the design of the distance estimation system, and finally the design of the proposed control system, as explained in the following sub-sections.

A. WIRELESS MODEL CONFIGURATION
Controlling the movement of the medical workers is an essential issue for establishing social distancing between each other and isolation rooms. Medical workers who are not allowed to approach isolation rooms need several warning levels as they approach these rooms. A design is proposed to track and locate workers based on improved PSO and ANN. The experiment was carried out in the Electrical Engineering Technical College using two ZigBee devices, as shown in Fig. 1(a). The first ZigBee is carried by the worker (mobile node), and the second ZigBee is the beacon node, which is installed at the height of 1.2 m, as shown in Fig.1(b). The RSSI signal was measured in different locations to estimate the distance between the worker and the isolation room. The mobile node was connected to a laptop to collect the RSSI signal using X-CTU software. The RSSI was collected every 1 m until the end of the study area was reached at a 27 m. A total of 30 RSSI samples were read in each of the 27 locations, i.e., a total of 810 samples. Fig. 2 shows the average of 30 RSSI samples versus distance; the power decreases as the distance increases and vice versa.

B. DISTANCE ESTIMATION
Two loss path models were used in this study -LNSM and POL. LNSM is one of the most popular models used to describe the relationship between RSSI and distance [10]. Statistical and experimental methods are typically used, where statistical models are based on measured values, while the experimental model is based on curve fitting. Therefore, the expression to define the LNSM model is represented below: where P dis is the path loss of power at a distance (dis). This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and content may change prior to final publication. The values of dis in this work range from 1 to 27 m. P diso o is the path loss power at dis o = 1 m. γ and σ are the path loss exponent and standard deviation, respectively, which are usually determined based on curve fitting. The RSSI signal of the mobile node carried by the workers is calculated as the difference between the transmitted power (P t ) and P dis , which is defined as [44], [45]: Therefore, the RSSI can be determined by substituting (1) into (2) as follows [46], [47]: This section aims to estimate the distance (dis e ) which is determined by rearranging (3), as defined below: he second path loss model is based on the curve-fitting tool provided by MATLAB. Many functions are provided by curve fitting. However, the POL is the most suitable for the current study, where the RSSI decreases with increasing distance. The POL model for calculating the distance (dis P OL e ) between the workers and beacon node is expressed as: The four coefficients (a, b, c, and d) need to be optimized to improve the performance of the POL model for distance estimation. For this purpose, PSO is the most popular algorithm used across a range of applications; however, the main drawback of PSO is trapping in local minima. Accordingly, improving PSO remains a challenge.

C. THE PROPOSED CONTROL SYSTEM BASED ON ANN
The main objective of this study is to ensure social distancing between medical workers and isolation rooms, which some staff for infection control purposes should not enter. Given the inherently high infectiousness and rapid spread of COVID-19 resulting from mixing healthy and sick people, an ANN-based control system is proposed. A three-level control system is proposed, comprising alarming, warning, and closing signals, as shown in Fig. 3. The first level (alarming) is implemented using a red light, the second level (warning) is implemented using sound, and the third level is a control signal to close the door of the isolation room. As noted above, the maximum distance used in the experimental tests was 27 m. The first control level is set at 20 m, meaning that when a worker reaches a distance of 20 m, the first control level (alarming) is activated. The second level (warning) is activated when the worker reaches 25 m. If the worker does not respond to the first and second levels and reaches a distance of 27 m, the last level will be activated, which is a control signal to close the isolation room door.
A neural network is a computational process that uses training to predict the output of a complex system [48]. Recently, ANNs have been used in various applications where they have achieved considerable success, resulting in their increasingly widespread use [49]. The ANN mimics biological neural activity. The ANN consists of three layers, i.e., input, hidden, and output, where each layer contains several neurons. The neurons connect with each other through links called weights. In previous literature, various algorithms have been introduced to train ANNs such that they can optimally perform the tasks assigned to them. One of the most popular algorithms is the back-propagation (BP) algorithm, which has achieved the lowest error rates [50].
The BP-ANN involves three phases, namely, forward, backward, and update weights [51]. The number of neurons in the input and output layers represents the number of inputs and outputs, which cannot be changed. However, the number of neurons in the hidden layer is one of the most critical factors affecting ANN performance. The proposed ANN in this work consists of two inputs which are distance and RSSI. The output layer consists of three outputs which are the control signal for alarming, the control signal for warning and the control signal for closing. Increasing the number of neurons in the hidden layer increases the accuracy of the ANN performance. To develop a high-accuracy control system, the number of neurons in the hidden layer was chosen by training four different ANN architectures, ranging from 5 to 20 neurons. After extensive study, the number of neurons in the hidden layer was chosen as 20, as depicted in Fig. 4.

IV. THE PROPOSED RNT-PSO METHOD
The optimization approach is starting to solve many problems of variable complexity across a range of fields of study. Therefore, introducing new optimization algorithms or improving existing ones is an essential aspect of ongoing work in this area.

A. CONVENTIONAL PSO METHOD
The most popular swarm intelligent optimization algorithm is PSO, introduced by Eberhart and Kennedy [20]. This approach mimics the social behavior of fish or birds. The candidates of the solution (swarms) move within the search space to find the global optimum solution. Each swarm updates its position according to two types of experience.
The first experience is a local experience, controlled by the C 1 parameter, and the second experience is a global experience, controlled by C 2 . Accordingly, some of the most critical parameters in PSO are the acceleration coefficients (C 1 and C 2 ), which are set to a value of 2 in conventional PSO, as shown in Fig. 5. The main drawback of PSO is the issue of trapping in local solutions where the swarms try to follow the global swarm despite the global swarm not achieving the global solution.
Since the acceleration coefficients (C 1 and C 2 ) are necessary to guide the movement of the swarms, many studies have introduced approaches to enhance PSO performance by finding suitable C 1 and C 2 values during the iteration process. The nonlinear time variation (NT-PSO) movement approach of C 1 and C 2 is one of the solutions described in the literature [52]. This variation of C 1 and C 2 is shown in Fig. 6.

B. THE PROPOSED RNT-PSO
The main drawback of PSO is the clustering of the swarms around local minima during earlier iterations, limiting the PSO's ability to explore the search space. Therefore, giving the local swarms the chance to move and explore the search space is vital to increase PSO efficiency. Furthermore, exploitation is usually enhanced by encouraging the swarms to move around the global solution at later iterations.
This work introduces a method to enhance the exploration and exploitation ability of conventional PSO. The proposed RNT-PSO achieves a balance between global and local swarms. The coefficient responsible for guiding local swarms is the cognitive coefficient (C 1 ), and the social coefficient(C 2 ) is responsible for guiding the global swarms. The proposed RNT-PSO controls these coefficients; at earlier iterations, the proposed approach gives higher weighting to (C 1 ), which then exponentially decreases. To improve the exploration ability of the proposed RNT-PSO, this exponential movement is mixed with a random value. The randomnonlinear variation enhances the ability of the PSO to investigate the entire search space while also reducing the likelihood of being trapped in local solutions. The proposed (C 1 ) is defined as: where C b 1 is the initial value of C 1 , which is set to 2.5, C e 1 is the final value of the C 1 , which is set to 0.5, t is the current iteration, τ is the maximum iteration, and rand is a random value varying from zero to one. The exploitation ability is enhanced in the proposed RNT-PSO through social coefficient C 2 , which is set to gradually increase to encourage the swarms to move toward the global solution. This increase in C 2 is modeled using randomnonlinear movement analogous to C 1 , as follows: where C b 2 is the initial value of the C 2 , which is set to 0.5, C e 2 is the final value of the C 2 , which is set to 2.5, t is the current iteration, and τ is the maximum iteration.
The movements of the proposed C 1 and C 2 coefficients are shown in Fig. 7. The velocity is defined as [20]:  where w is the inertia, therefore, the new position for the swarms is defined as [20]: The overall procedure of the proposed RNT-PSO is shown in Fig. 8.

C. VERIFICATION OF THE PROPOSED RNT-PSO METHOD
To verify the reliability and efficiency of any new or improved optimization algorithm, benchmark functions should be carried out. Many benchmark functions have been described in the literature [53], [54]. A range of characteristics has been identified to describe the functions, such as linear, nonlinear, and modality. The most important term in optimization is the modality [55], which refers to the number of peaks in the benchmark function. Two types of modality have been found, which are unimodal and multimodal benchmark functions. The benchmark function is considered unimodal if it has one peak; otherwise, it is considered multimodal. If the function is multimodal, trapping in local minima may occur during the search for the global solution. Accordingly, the multimodal benchmark function is considered more complex than the unimodal function. Thus, testing the improved optimization algorithm using unimodal and multimodal benchmark functions is particularly important. Another important term is the dimension of the problem (n), which refers to the number of variables for which the optimization algorithm is trying to solve and usually varies from 2 to 30 [55]. Increasing the dimension makes the problem more difficult when trying to find the global solution [56]; accordingly, it is vital to increase the dimension when testing any algorithm.
To evaluate the efficiency of the proposed RNT-PSO, a unimodal test was carried out. The proposed RNT-PSO is subjected to a rotated hyper-ellipsoid benchmark function (f 1 ) to seek the global solution. Fig. 9. shows that (f 1 ) has one peak only; accordingly, it is a unimodal function [57].
The function (f 1 ) is defined as: As noted above, the difficulty of solving any problem will increase with increasing dimension. Therefore, the dimension (n) was set as 30. The lower and upper bounds are -65 and 65, respectively, and the optimum value of (f 1 ) is 0.
To further evaluate the efficiency of the proposed RNT-PSO, the alpine benchmark function (f 2 ) was used. As shown in Fig. 10, this is a multimodal function with more than one peak. Performing a multimodal test is important in testing the improved optimization algorithm. In particular, the multimodal function (f 2 ) tests the ability of the optimization algorithm to escape from local minima and move toward the global optimum. The alpine benchmark function (f 2 ) is given by [58]: As the dimensionality is significantly important, the dimension of the problem (n) was set to 30. The lower bound, upper bound, and optimum solution are -10, 10, and 0, respectively.

V. RNT-PSO-POL ALGORITHM
The RNT-PSO is suggested to improve the performance of the POL model for distance estimation. Therefore, the problem must be formulated. Then the RNT-PSO algorithm is implemented. Further details are below.

A. PROBLEM FORMULATION
An optimization algorithm requires three crucial elements to perform the task entrusted to it, namely, the dimension of the problem, a fitness function, and problem constraints. The optimization algorithm is developed to find the optimal values within the dimension of the problem by evaluating the elements using the fitness function, taking into account the problem's constraints.
The first step is to define the dimension of the problem (d), which refers to the number of elements to be optimized. The dimension of the problem can be expressed as [17]: where B i,j are the j th solution in the population during the i th iteration, and B k i,j is the k th element of B i,j . The d parameter represents the total number of elements.
One of the most important aspects of optimization is developing a suitable fitness function to evaluate the candidates of solution (B i,j ). The fitness function is formulated in such a way as to generate the optimum solution. The fitness function that was developed in this study is the MAE, which is defined as [42]: where m is the number of locations (i.e., 27 locations). The third element of implementing the optimization algorithm is applying constraints to find the optimum element values. The constraints mean the borders of each element, where each element should have an upper and lower border. During the iteration process, any element may move away from its borders. In this case, the element must be regenerated within its borders.

B. IMPLEMENTATION OF RNT-PSO-BASED OPTIMUM POL ALGORITHM
As the RNT-PSO achieved the best solution among the other algorithms, this approach was developed to optimize the POL model. The RNT-PSO based optimum POL (RNT-PSO-POL) approach began by defining the relevant parameters, namely the number of iterations (τ ) and the number of swarms (N ). The values of τ and N were set to 10,000 and 20, respectively. The goal of implementing the RNT-PSO-based POL was to determine the optimal values of elements a, b, c, and d in (5); accordingly, the dimension of the problem (d) is 4. The inertia (w) was set to 0.75.
The first step in the RNT-PSO-POL algorithm is the generation of initial swarms, which are encoded using (12). The initial swarms are evaluated based on the developed fitness function described in (13). The cognitive coefficient (C 1 ) is calculated using (6); the social coefficient (C 2 ) is then calculated using (7). The RNT-PSO-POL algorithm then calculates velocities using (8).
The last step in the swarm update process is updating their positions, which is implemented according to (9). If the RNT-PSO-POL reaches the maximum number of iterations, the optimum a, b, c, and d values are obtained. Fig. 11 depicts the overall process of the implementation of the RNT-PSO-POL algorithm.

VI. RESULTS AND DISCUSSION
The RNT has been used to improve the PSO algorithm. Two models are used for distance estimation, which is LNSM and POL. The proposed RNT-PSO has been used to improve the performance of the POL model. The main objective of this study is to ensure social distancing between medical workers and isolation rooms which is implemented using an ANNbased control system. The results are described below in detail.

A. RNT-PSO RESULTS
To evaluate the performance of the proposed RNT-PSO algorithm, two benchmark functions were considered, namely the rotated hyper-ellipsoid and alpine benchmark functions.

1) TUNING OF THE ALGORITHMS
Numerous parameters should be set before evaluating the proposed algorithm (RNT-PSO) and comparing it with the other algorithms. The main algorithm parameters are defined in Table 2.

2) BENCHMARK FUNCTION RESULTS
Two benchmark functions were considered to evaluate the proposed RNT-PSO algorithm: the rotated hyper-ellipsoid function (unimodal) and the alpine function (multimodal). The proposed RNT-PSO was compared with nonlinear time variation PSO (NT-PSO), and conventional PSO approaches. Furthermore, two well-known algorithms (GSA and HSA) were considered for further evaluation. Fig. 12 shows the convergence characteristics of the rotated hyper-ellipsoid function. The proposed RNT-PSO exhibits clearly superior characteristics compared to the other algorithms, with faster performance and the ability to successfully explore and move toward the global minima. This means that the RNT-PSO also avoids the issue of becoming trapped in local minima. Furthermore, the RNT-PSO achieved a value of 1.459 × 10 −26 , which is the best result of any of the algorithms.  These results demonstrate that the exploitation ability of the proposed RNT-PSO is significantly better than that of the other algorithms. Fig. 13 shows the response of the alpine function based on RNT-PSO, NT-PSO, PSO, GSA and HSA algorithms. This figure also shows that the proposed RNT-PSO algorithm achieved better performance than the other algorithms. The exploration of the RNT-PSO is improved, and the convergence of the RNT-PSO approach is also faster than that of the other algorithms. Furthermore, exploitation is also improved based on RNT-PSO, with a minimum result of 0.000125 achieved by the RNT-PSO. This finding indicates that the proposed algorithm can effectively handle different types of functions; thus, the proposed algorithm has been implemented successfully.

B. LNSM RESULTS
The results of the distance estimation based on the LNSM model are described in this section. The RSSI signals were measured at 27 locations. At each location, 30 samples were measured. These samples were then averaged, with the relationship between the average samples and distance shown in Fig. 14. This figure shows the mathematical model, standard Accordingly, the distance estimation between the medical worker carrying the mobile node and the isolation rooms was measured based on RSSI, which is defined as: To evaluate the performance of the LNSM model, the absolute error was calculated, i.e., the difference between the real distance (dis r ) and estimated distance dis e , as defined below: The error was computed as depicted in Fig. 15. Distance from 0-27 m is shown on the x-axis, and the error is shown on the y-axis. The error value was plotted as a vertical bar per sample. The figure shows that the error varies from 0 to 5m. The mean absolute error (MAE) was also calculated for all 27 locations; the MAE was found to be 1.777 m and is plotted as a dotted blue line in Fig. 15. This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2022.3183124

C. RNT-PSO-POL RESULTS
To improve the POL model, the proposed RTN-PSO was used to determine the optimum coefficients (a, b, c, and d).
The convergence characteristics of the RTN-PSO-based PLO model are shown in Fig. 16. The number of the iterations was set to 10,000, with stability achieved after iteration number 6,000, meaning that saturation is reached and the error rate cannot be subsequently reduced further. After completing the implementation of the RTN-PSO-POL algorithm, the MAE was found to be 1.433 m. The final outputs of the RTN-PSO are the optimum values of POL coefficients a, b, c, and d, whose values were found to be -0.00073013, -0.0866, -3.4837, and -45.3558, respectively. Therefore, the RTN-PSO-POL model is expressed as:

D. ERROR ESTIMATION
To evaluate the performance of the proposed RNT-PSO-POL and LNSM models according to distance estimation, the MAE between the medical workers and isolation rooms was utilized, as shown in Fig. 17.

E. BP-ANN RESULTS
The results of the BP-ANN approach are presented in this section. Four ANN were tested, i.e., 2-5-3, 2-10-3, 2-15-3, and 2-20-3. The BP-ANN was trained to perform as a control system with high accuracy. The performance of the BP-ANN, as measured in terms of mean square error (MSE), is shown in Fig. 18. The number of the iterations was set to 1,000. Fig. 18 demonstrates that the best performance was achieved based on 20 neurons in the hidden layer. The MSE value of the 2-20-3 BP-ANN configuration was 1.0695 × 10 −12 . This obtained MSE value shows that the proposed control system successfully achieved a very convincing result, thus demonstrating that the ANN can be used with high efficiency in the proposed control system. To verify the sensitivity of the proposed control system, each ANN topology (2-5-3, 2-10-3, 2-15-3, 2-20-3) has been run 30 times. The goal has been set to 1×10-10. The sensitivity was found to 87%, 70%, 57% and 43% for 2-20-3, 2-15-3, 2-10-3, 2-5-3, respectively.

F. COMPARISON RESULTS
The two proposed models (RNT-PSO-POL and LNSM) were compared with various previous studies of medical worker estimation distance. This comparison was achieved based on several factors: the technology used, the adopted method, and the tested area, as shown in Table 3. A comparison This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and content may change prior to final publication. was also achieved based on the MAE for all studies. Table  3 clearly demonstrates that the proposed RNT-PSO-POL algorithm achieved superior results compared to the other algorithms, with an MAE value of 1.433 m. These results show the accuracy of the proposed algorithm in locating medical workers; thus, it can be used with high accuracy to warn workers when approaching isolation rooms. Table 4 shows the results of the proposed RNT-PSO approach along with those of the PSO, NT-PSO, GSA and HSA methods. The comparison was based on the rotated hyper-ellipsoid and alpine benchmark functions described above. Table 4 clearly shows the superiority of the proposed RNT-PSO algorithm over the other algorithms concerning both benchmark functions.

VII. CONCLUSION
A control system to establish social distancing between medical workers and isolation rooms was presented in this work. The experiments were conducted at the Electrical Engineering Technical College, with a maximum experimental distance of 27 m. Two models (LNSM and POL) were utilized to estimate the distance between medical workers and the isolation room. First, the distance was measured based on the LNSM model. The second model (POL) was based on the relationship between the received RSSI and the distance. However, the coefficients of the POL model need to be optimized. One of the most well-known algorithms for coefficient optimization is PSO; however, one of its key drawbacks is the issue of the solution becoming trapped in local minima. This paper introduces a new concept to escape from local minima in PSO using random-nonlinear time variation (RNT-PSO).
The essential motivation of this improvement is the random-non-linear movement of coefficients C 1 and C 2 . The movement of these coefficients was modeled using an exponential model. The RNT-PSO has some critical differences from other algorithms, chief among which is the simple application of RNT-PSO to various problems. Furthermore, the solutions of RNT-PSO are focused on the balance between global and local swarms, with local swarms given greater opportunities to explore at earlier iterations. The RNT-PSO is compared with conventional PSO and nonlinear time variation-PSO (NT-PSO). Furthermore, the RNT-PSO is compared with two well-known algorithms: gravitational search algorithm and harmony search algorithm.
The RNT-PSO showed superior performance relative to other algorithms; therefore, RNT-PSO was used to improve the POL model (RNT-PSO-POL). The MAE of the RNT-PSO-POL is 1.433 m compared to an MAE of 1.777 m for the LNSM approach. The study outcomes indicate that the RNT-PSO-POL achieves superior results, with a 19% better MAE than the LNSM approach. The final step of the study was to develop an ANN for controlling three signals (alarming, warning and closing), which achieved very convincing results. These findings demonstrate that the ANN can be used successfully for control systems to establish distance be-tween medical workers and isolation rooms. As future work, this research can be expanded by using other optimization algorithms and other artificial intelligence methods.

ACKNOWLEDGMENT
The author would like to thank the staff of the Department of Computer Engineering Techniques, Electrical Engineering Technical College, Middle Technical University for their support during this study.