{'fraction_non_alphanumeric': 0.031003944804423252, 'fraction_numerical': 0.01744268943774655, 'mean_word_length': 4.334854631507776, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Accurate Indoor-Positioning Model Based on People Effect and Ray-Tracing Propagation

Wireless local area networks (WLAN)-fingerprinting has been highlighted as the preferred technology for indoor positioning due to its accurate positioning and minimal infrastructure cost. However, its accuracy is highly influenced by obstacles that cause fluctuation in the signal strength. Many researchers have modeled static obstacles such as walls and ceilings, but few studies have modeled the people’s presence effect (PPE), although the human body has a great impact on signal strength. Therefore, PPE must be addressed to obtain accurate positioning results. Previous research has proposed a model to address this issue, but these studies only considered the direct path signal between the transmitter and the receiver whereas multipath effects such as reflection also have a significant influence on indoor signal propagation. This research proposes an accurate indoor-positioning model by considering people’s presence and multipath using ray-tracing, we call it (AIRY). This study proposed two solutions to construct AIRY: an automatic radio map using ray tracing and a constant of people’s effect for the received signal strength indicator (RSSI) adaptation. The proposed model was simulated using MATLAB software and tested at Level 3, Menara Razak, Universiti Teknologi Malaysia. A K-nearest-neighbor (KNN) algorithm was used to define a position. The initial accuracy was 2.04 m, which then reduced to 0.57 m after people’s presence and multipath effects were considered.

Indoor positioning can be classified into device-based and device-free. On device-based systems, users need a device to know their position, such as smartphone-based and tag-based indoor positioning [15]. Instead of a device-free system, the user does not need a device to know his position. Users here can be people or objects. Device-free localization based on signal strength (received signal strength indicator, RSSI) has three main techniques: fingerprinting, link-based, and radio tomographic imaging. From the user side, device-free is more practical. However, from the system side, it will be more complex, for example it takes 6 to 20 transceiver nodes for fingerprinting techniques, k-neighbors based on its distance from the query instance [44]. KNN based on the fingerprinting approach is widely used in indoor localization systems due to its high localization accuracy. It is very simple and fast because it compares an online instance with training dataset entries. Therefore, this research was conducted using the deterministic approach and KNN was adopted as the positioning algorithm because of its simplicity and high accuracy, besides requiring minimum computational power and time.

People Presence Effect
Many studies have modeled static obstacles such as walls and ceilings, but few have modeled the effect of people presence. Human bodies absorb, reflect, and diffract WLAN signals, which could affect the value of RSSI. Thus, if offline mapping were performed with no or few people and positioning were performed with many people, the system could lose reliability. The results of past studies have shown that, on average, the presence of human bodies increased the error rate by 11% regardless of the algorithm used [45].
The human activity around MS affects WLAN signal strength [26]. One past study observed a relationship between the fluctuations in RSSI and people activity within a WLAN coverage area. This relationship can be used to build better human detection and tracking systems [27]. Koda et al. [46] measured the attenuation of IEEE 802.11ad WLAN signals in a 60 GHz band caused by human blockage. Subsequently, Slezak et al. [25] conducted empirical studies of human-body blockage in mm-Wave communications.
Booranawong et al. [26] proposed well-known filtering methods (i.e., the moving average and the exponentially weighted moving average filters) and the span thresholding filter to reduce RSSI variations and obtained an estimated position error because of human movement. Unfortunately, the size of the room used for the test was quite small and the error was still above 1 m.
Iyad et al. [28] presented an experiment and found that people's presence between the AP and the MD reduced the received signal strength by −2 dBm to −5 dBm. Following that, Iyad et al. [47] also performed other experiments to prove that the effect of human presence could be determined based on the distance between the MD and the people, also termed as the influence distance. Both studies explained the effect of people presence around the MD on RSSI and attempted to determine this effect on the quality of IPS. The result was improved positioning accuracy from 1.9 m to 1.7 m. Although the technique succeeded in improving accuracy, it still needs further research to obtain significant accuracy improvements. Iyad [47] subsequently used a multi-wall propagation model that only focuses on signals directly from the transmitter to the receiver. This current research proposes new techniques that consider the multipath effect such as reflection to overcome radio map generation and the issues of the people presence effect (PPE), to obtain a signal accuracy of less than 1 m.

Materials and Methods
The proposed model, an accurate IPS based on people effect and ray-tracing propagation (AIRY), is outlined in Figure 1. This model was derived from the basic IPS fingerprinting model with some additional features added to overcome the issues explained in the previous section. The first additional feature is an automatic radio map generator using ray-tracing (ARM-RT) to solve the time-consuming problem of manual radio map construction. ARM-RT can provide a fast and accurate radio map. The second additional feature is RSSI adaptation to solve the fluctuation of RSSI due to PPE to enhance the accuracy of the IPS.
In the offline stage, an automatic radio map is created using a ray-tracing propagation model. The input is a map of the building, the AP location (x, y, z), and the transmittance power of each AP. In this study, 3 APs with 2.9 m height were used. There are only 3 APs on the whole floor (80 × 16 m) of level 3 Menara Razak, but the detected Wi-Fi signal on the 3rd floor can be up to 6 SSID that come from other floors. The system was selected 3 APs based on their MAC address. Then, the location estimation was done in the online stage. This process was done by matching the initial RSSI vector Sensors 2019, 19, 5546 5 of 27 measured by the user at a specific position with the RSSI vectors in the RM database [19]. The KNN algorithm was adopted as the fingerprint matching algorithm because of its acceptable accuracy and its relevance with the limitations of mobile devices [48].
The KNN algorithm requires two parameters: (1) "k", which is the number of the considered nearest neighbors, and (2) the distance function. The distance function was set to the Euclidean distance, while "k" was set to a value of 3 to get the best accuracy [48]. The output of this process is an initial location estimation, which is still less accurate because it has not incorporated the effects of people around the user. Thus, if offline mapping were performed with a few people followed by positioning with many people, the system could lose reliability. To improve accuracy, the next step must incorporate the conditions around the initial position, especially the people around the initial position. Based on the position of people around the MD, an RSSI adaptation process was applied to the RSSI vectors to produce adapted RSSI vectors (ARV). Then, the ARV was matched with the RM, as per the previous process using the KNN algorithm. As a result, accurate position estimations are obtained.
The adopted methodology of this research is shown in Figure 2, consisting of 5 steps, starting from the development of a manual radio map until the validation of the proposed model. The KNN algorithm requires two parameters: (1) "k", which is the number of the considered nearest neighbors, and (2) the distance function. The distance function was set to the Euclidean distance, while "k" was set to a value of 3 to get the best accuracy [48]. The output of this process is an initial location estimation, which is still less accurate because it has not incorporated the effects of people around the user. Thus, if offline mapping were performed with a few people followed by positioning with many people, the system could lose reliability. To improve accuracy, the next step must incorporate the conditions around the initial position, especially the people around the initial position. Based on the position of people around the MD, an RSSI adaptation process was applied to the RSSI vectors to produce adapted RSSI vectors (ARV). Then, the ARV was matched with the RM, as per the previous process using the KNN algorithm. As a result, accurate position estimations are obtained.
The adopted methodology of this research is shown in Figure 2, consisting of 5 steps, starting from the development of a manual radio map until the validation of the proposed model.

The Development of a Manual Radio Map (MRM)
The first step is the development of a manual radio map (MRM) database. The goal of this step is to build a testing set that will be used to calibrate and validate the proposed solution of this research. This step uses a Wi-Fi scanner Android application to collect information (MAC address and RSSI) from the IEEE 802.11 beacon frames broadcasted by the APs.
Data were recorded at points separated by a distance of 1 m. A total of 30 RSSIs were recorded at each point and the median value taken as the radio map data. Data retrieval was undertaken when there were no people around the MD. The collected RSSI and location data were then stored in a Microsoft Excel file, which was later used for simulation and computing in MATLAB software. The location of the study was Level 3 of Menara Razak, Universiti Teknologi Malaysia Kuala Lumpur (size of 80 m × 16 m).
The RSSI measurement procedure is the mobile device fixed on a tripod in all experiments. The MD height is 1 m above the floor. Then the experimenter walked away about 10 m from the MD when measuring each point. The experimenter pressed the button on the android application used to record RSSI. There is a time delay feature in the application before starting the RSSI recording so that there is time for the experimenter to walk away from the MD. After the RSSI recording is finished there is a beep sound so the experimenter knows when he can return to the MD.

The Development of an Automatic Radio Map Using Ray Tracing (ARM-RT)
The second step involves the development of an automatic radio map using a ray-tracing propagation model (ARM-RT). The details of this device and the process of ARM-RT construction are shown in Figure 3. The inputs are a map of the building, information on material type, relative permittivity, transmitter location (AP) in (x, y, z), the transmit power of AP, and the receiver (MD) height. The output is the RSSI for all rooms, where the RSSI is calculated using a ray-tracing model at every 1 m distance, the same position as that of MRM. Then, the RRSI, which is the output of the modeling, was compared with MRM and an automatic radio map using a multi-wall model (ARM-MW) as per Iyad [48] was constructed using mean squared error (MSE).

The Development of a Manual Radio Map (MRM)
The first step is the development of a manual radio map (MRM) database. The goal of this step is to build a testing set that will be used to calibrate and validate the proposed solution of this research. This step uses a Wi-Fi scanner Android application to collect information (MAC address and RSSI) from the IEEE 802.11 beacon frames broadcasted by the APs.
Data were recorded at points separated by a distance of 1 m. A total of 30 RSSIs were recorded at each point and the median value taken as the radio map data. Data retrieval was undertaken when there were no people around the MD. The collected RSSI and location data were then stored in a Microsoft Excel file, which was later used for simulation and computing in MATLAB software. The location of the study was Level 3 of Menara Razak, Universiti Teknologi Malaysia Kuala Lumpur (size of 80 m × 16 m).
The RSSI measurement procedure is the mobile device fixed on a tripod in all experiments. The MD height is 1 m above the floor. Then the experimenter walked away about 10 m from the MD when measuring each point. The experimenter pressed the button on the android application used to record RSSI. There is a time delay feature in the application before starting the RSSI recording so that there is time for the experimenter to walk away from the MD. After the RSSI recording is finished there is a beep sound so the experimenter knows when he can return to the MD.

The Development of an Automatic Radio Map Using Ray Tracing (ARM-RT)
The second step involves the development of an automatic radio map using a ray-tracing propagation model (ARM-RT). The details of this device and the process of ARM-RT construction are shown in Figure 3. The inputs are a map of the building, information on material type, relative permittivity, transmitter location (AP) in (x, y, z), the transmit power of AP, and the receiver (MD) height. The output is the RSSI for all rooms, where the RSSI is calculated using a ray-tracing model at every 1 m distance, the same position as that of MRM. Then, the RRSI, which is the output of the modeling, was compared with MRM and an automatic radio map using a multi-wall model (ARM-MW) as per Iyad [48] was constructed using mean squared error (MSE). The ray-tracing (RT) method was based on ray optics, which solves Maxwell's equations in the high-frequency regime. Thus, the RT method is a general propagation modeling tool that provides estimates of path loss, the angle of arrival/departure, and time delays [49]. The RT model was initially applied in optical propagation models. The RT model is based on the ray-optic approximation of the propagating field [50] and the uniform theory of diffraction (UTD) [51]. Following that, RT started to be applied in the field of radio propagation in the early 1990s [52]. RT is used for received signal strength (RSS) prediction in urban [53] and indoor environments [54].
The RT technique is an approach that can obtain channel characteristics by identifying the contributions of individual multipath components and then calculating their composition at the receiver, as outlined in Equation (1) [55].
E ̅ 0 is the field on the unit sphere; ∏ R ̿ i and ∏ T ̿ i are, respectively, the reflection and transmission coefficient dyads along the whole ray path; ∏ e −jβ o l i is the product of the propagation phase variations of this ray contribution starting from the unit sphere; and SF = √A 0 √A r ⁄ is the spreading factor. Additionally, A 0 , and A r are the cross-sectional areas at the unit sphere and the receiver point, respectively [56].
The dielectric properties of the materials affect the field strength of the propagation paths. Permittivity is one of the main material qualities that is important to consider in RT. Permittivity is typically denoted by ε. Permittivity is a measure of how much the molecules in a material oppose the external E-field. Ray tracing uses relative permittivity (ε r ) or a dielectric constant. The permittivity of a medium is expressed as the product of the dielectric constant and free space permittivity (ε 0 ). Each material, including human tissue, has a different relative permittivity value. The relative permittivity of building materials is listed in Table 1. The building map image file was first changed to csv file format containing the coordinate of each wall, floor, ceiling, as well as relative permittivity value. The server then calculated the RSSI using MATLAB by running the ray-tracing model and storing the ARM-RT database. Relative permittivity values were referred from the databases of previous studies (Table 1). The procedures started with writing the program script based on the ray-tracing propagation model then by The ray-tracing (RT) method was based on ray optics, which solves Maxwell's equations in the high-frequency regime. Thus, the RT method is a general propagation modeling tool that provides estimates of path loss, the angle of arrival/departure, and time delays [49]. The RT model was initially applied in optical propagation models. The RT model is based on the ray-optic approximation of the propagating field [50] and the uniform theory of diffraction (UTD) [51]. Following that, RT started to be applied in the field of radio propagation in the early 1990s [52]. RT is used for received signal strength (RSS) prediction in urban [53] and indoor environments [54].
The RT technique is an approach that can obtain channel characteristics by identifying the contributions of individual multipath components and then calculating their composition at the receiver, as outlined in Equation (1) [55].
E 0 is the field on the unit sphere; = R i and = T i are, respectively, the reflection and transmission coefficient dyads along the whole ray path; e −jβ o l i is the product of the propagation phase variations of this ray contribution starting from the unit sphere; and SF = √ A 0 / √ A r is the spreading factor. Additionally, A 0 , and A r are the cross-sectional areas at the unit sphere and the receiver point, respectively [56].
The dielectric properties of the materials affect the field strength of the propagation paths. Permittivity is one of the main material qualities that is important to consider in RT. Permittivity is typically denoted by ε. Permittivity is a measure of how much the molecules in a material oppose the external E-field. Ray tracing uses relative permittivity (ε r ) or a dielectric constant. The permittivity of a medium is expressed as the product of the dielectric constant and free space permittivity (ε 0 ). Each material, including human tissue, has a different relative permittivity value. The relative permittivity of building materials is listed in Table 1. The building map image file was first changed to csv file format containing the coordinate of each wall, floor, ceiling, as well as relative permittivity value. The server then calculated the RSSI using MATLAB by running the ray-tracing model and storing the ARM-RT database. Relative permittivity values were referred from the databases of previous studies (Table 1). The procedures started with writing the program script based on the ray-tracing propagation model then by defining the layout and parameters of the building; running the simulation; and comparing it to MRM by calculating mean squared error (MSE). The pseudocode of the ray-tracing propagation model is presented in Algorithm 1. 3D Formation o f the Structure 3: Calculating Fresnel Coe f f icients f or Walls 4: For i ← 1 to size (wall.xyz1, 1) do 5: f ind re f lection and transmission Fresnel coe f f icient f or each wall 6: End For 7: Meshing the Boundary Volume and Assign the RX height 8: Calculating the Distance o f TX(s) f rom every mesh node RXi 9: For i ← 1 to do 10: f ind the distance 11: End For 12: Equating the Panels (Walls) in 3D 13: f inding the projection o f TX on each panel 14: calculating the re f lection (mirror) o f TX across each panel 15: Calculating the 2nd Image o f TX across each wall 16: Calculating LOS Components 17: Calculating Multipath & Re f lection Components 18: f ind the re f lection coe f f icient 19: count the walls between re f lection paths 20: f ind the antenna gain and beam departure angle 21: calculating the angle o f arrival 22: f ind the walls between TX and the re f lection point 23: f ind f inite walls between re f lection point and RX 24: f ind the number o f walls between re f lection paths 25: calculate the received signal at RX f rom the re f lection point on wall j 26: calculate 2nd re f lection 27: Drawing the Maps 28: LOS Propagation Map Only (a) 29: 1st Re f lection Propagation Map Only (b) 30: 2nd Re f lection Propagation Map Only (c) 31: LOS and Propagation Map = a + b + c 32: Return ARMRT Information on the building layout and type of material used is required to run ray-tracing simulations. The building layout is given in Figure 4 while the type of material is described in Table 2. Then the parameters of ray-tracing simulation in Matlab is shown in Table 3.   The shape, size, and relative permittivity value of each wall, floor, and ceiling were defined according to the type of material used to construct them. The ray-tracing method is based on ray optics, which solves Maxwell's equations in the high-frequency regime. Thus, the ray-tracing method is a general propagation modeling tool that provides estimates of path loss, the angle of arrival/departure, and time delays [49]. The ray-tracing technique has been verified in numerous past works as a promising method for indoor radio propagation modeling. The RT model is a good solution to provide an accurate, site-specific field prediction and multidimensional characterization of the radio propagation channel in the time, space, and polarization domains. This is because the model has an intrinsic capability to simulate multipath propagation [58].
The image method was used for the ray-tracing model in the current simulation. RT considers transmission and reflections to predict RSSI. Although using three reflection rays is not an important contributor to signal strength [52]; when considering more than 2 reflections, up to 6, the signal strength changes by only 1 dB, but the complexity and execution time increase exponentially [59]. Therefore, two reflection rays were used in the current simulation. The detail of the parameters used in the simulation is listed in Table 4.  The shape, size, and relative permittivity value of each wall, floor, and ceiling were defined according to the type of material used to construct them. The ray-tracing method is based on ray optics, which solves Maxwell's equations in the high-frequency regime. Thus, the ray-tracing method is a general propagation modeling tool that provides estimates of path loss, the angle of arrival/departure, and time delays [49]. The ray-tracing technique has been verified in numerous past works as a promising method for indoor radio propagation modeling. The RT model is a good solution to provide an accurate, site-specific field prediction and multidimensional characterization of the radio propagation channel in the time, space, and polarization domains. This is because the model has an intrinsic capability to simulate multipath propagation [58].
The image method was used for the ray-tracing model in the current simulation. RT considers transmission and reflections to predict RSSI. Although using three reflection rays is not an important contributor to signal strength [52]; when considering more than 2 reflections, up to 6, the signal strength changes by only 1 dB, but the complexity and execution time increase exponentially [59]. Therefore, two reflection rays were used in the current simulation. The detail of the parameters used in the simulation is listed in Table 4. If a ray is reflected/transmitted one or more times before reaching the field point, the ray is called a reflected/transmitted ray. This ray corresponds to the reflection/transmission of EM waves at the interface between different mediums. The propagation direction of a reflected/transmitted ray is determined by the law of reflection/refraction. The magnitude of the reflected/transmitted field is determined by Fresnel's equations for different polarizations [49]. The procedure is recursive and can be implemented conveniently in a computer program.

The Development of Received Signal Strength Indicator (RSSI) Adaptation
The third step is the development of RSSI adaptation. This step aims to determine the effect of people on RSSI. This step obtains the delta RSSI and takes it as the line of sight (LOS) or non-line of sight (NLOS) PPE constant to use in RSSI adaptation-Explained in detail in the fourth step. Delta RSSI consists of the different values of RSSI when there is one person or more and when there are no people. Three experiments were performed in this step. The purpose of the first experiment is to determine the effect of one person on the RSSI in the LOS position. Meanwhile, the second and third experiments aim to determine the effect of one person and many people on RSSI in the NLOS position. The people in the LOS position are the people that are blocking the direct signals from the AP to te hMD. These experiments were conducted at the auditorium of the Faculty of Industrial Technology, Universitas Islam Indonesia, Yogyakarta, in a room measuring 13 m × 17 m.
The required devices to record RSSI are 3 Access Points (Linksys WAP300N from Linksys and made in Taiwan), 1 Mobile Device (Xiaomi Redmi note 3), and an Android application. The APs (Linksys WAP300N) in this experiment is setting as Wi-Fi Access Point (default) operation mode and 2.4GHz frequency band. There is no beam-forming configuration here. The first procedure for all three experiments involved the setting up of APs and MDs with varied AP heights (1 m, 2 m, 3 m), whereas the height of the MD was set to 1 m. Therefore, the distance between the AP and the MD was 10 m. The MD recorded 30 RSSIs at each position.
In the first experiment, one person would stand between the AP and the MD in the LOS position, with varying distances from the MD (r) ranging from 1 m to 9 m, as shown in Figure 5. In the second experiment, one person would stand around the MD in the NLOS position, with varying distances from the MD (1 m, 2 m, 3 m). In the third experiment, many people would stand around the MD in the NLOS position, with varying distances from the MD (1 m, 2 m, 3 m).
In the second experiment, the position of the people was set up to not directly block the signal from the AP to the MD, i.e., only one person's position around the MD was used. The people's position in this experiment was divided into three rings, representing a people position of 1 m, 2 m, or 3 m from the MD. The variations in the people's positions can be seen in Figure 6 for the first ring, Figure 7 for the second ring, and Figure 8 for the third ring. As per the previous experiment, 3 APs were used in this experiment. The height of the access points was set to 1 m for AP1, 2 m for AP2, and 3 m for AP3, and the height of the mobile device was set to 1 m from the floor. Sensors 2020, 20, x FOR PEER REVIEW 11 of 26          The third experiment aimed to determine how the presence of many people around MD would affect RSSI. This experiment used 2 to 13 people with a varied position and distance to the MD starting at a distance of 1 m (first ring), as shown in Table 5, followed by a distance of 2 m and 3 m, as described in Table 6, Table 7. Table 5. Position variation of many people around MD in the first ring (see Figure 6).  Table 6. Position variation of many people around MD in the second ring (see Figure 7).  Table 7. Position variation of many people around MD in the third ring (see Figure 8).  The third experiment aimed to determine how the presence of many people around MD would affect RSSI. This experiment used 2 to 13 people with a varied position and distance to the MD starting at a distance of 1 m (first ring), as shown in Table 5, followed by a distance of 2 m and 3 m, as described in Table 6, Table 7. Table 5. Position variation of many people around MD in the first ring (see Figure 6). • 1a, 1b, 1c, 1e, 1f, 1g 7 people • 1a, 1b, 1c, 1d, 1e, 1f, 1g Table 6. Position variation of many people around MD in the second ring (see Figure 7). Ring   2 people  3 people  5 people  9

The Development of an Accurate Indoor-Positioning System (IPS) Based on People Effect and Ray-Tracing (AIRY)
The basic concept of the fingerprint technique has been explained in the literature review section. In the offline stage, the automatic radio map database was obtained using ray-tracing propagation. In the online stage, the user measures the RSSI in which he/she stands and holds the MD. Then, the measurement results are referred to as the initial RSSI vectors. These initial RSSI vectors were matched with the ARM-RT database using the KNN algorithm, which produces initial position estimations.
The additional steps in the proposed method involved counting the adapted RSSI vectors to obtain an accurate position. Adapted RSSI vectors were calculated based on the initial RSSI as input and considering the presence of people around the initial position. If people were present around the initial position, then the next step involved detecting whether the people positions were in the LOS or NLOS positions. The LOS position means that the people stood to block the direct path between the transmitter (AP) and the receiver (MD) while the NLOS position meant that the position of the person did not block the direct path.
The following rules were applied for the adaptation of the RSSI vector: • If there are people in the NLOS position between the AP position and the initial position, then, the RSSI is added with an "NLOS PPE constant". The value of both parameters, NLOS PPE and LOS PPE constants, was calculated in the previous step. After obtaining an adapted RSSI vector, the last step involved calculating accurate positions using the KNN algorithm. Finally, the accuracy of the accurate position was compared to the initial position.

Validating the Proposed Method
This step consists of two validation processes-the validation of ARM and the validation of AIRY. The validation of ARM was done by calculating the error of the system. To evaluate the positioning method, different performance metrics including accuracy, precision, and responsiveness have been proposed in past studies. Liu et al. [60] used accuracy, complexity, scalability, robustness, and cost as performance metrics. On the other hand, Farid et al. [18] used accuracy, responsiveness, coverage, adaptiveness, scalability, cost, and complexity. Dardari [61] used position estimation error, coverage, robustness, and scalability.
One of the most important features of a localization system is the accuracy of the user/device position [62]. Indoor environments provide a challenging space for localization systems to operate due to the presence of obstacles and multipath effects. Therefore, the system needs to limit the impact of multipath effects and other environmental noises to obtain highly accurate estimates. Positioning accuracy is used as a performance metric in this research. Positioning accuracy refers to the difference between the estimated position and the actual position [63] as in Equation (2): Accuracy can be calculated as the root of the squared difference between each pair of location points where x a , y a is the coordinate of an actual point and x p , y p is the coordinate of the predicted point.

The Development of a Manual Radio Map
This experiment was carried out on the third floor of Razak Tower, UTM Kuala Lumpur, where RSSI was obtained at 523 points from 20 rooms and corridors. The maximum values of RSSI were −50 dBm, −40 dBm, and −45 dBm for the RSSI transmitted from AP1, AP2, and AP3, respectively. Following that, the minimum RSSI were −89 dBm, −84 dBm, and −87 dBm. The standard deviations for RSSI 1 , RSSI 2 , and RSSI 3 were 7.1, 11.06, and 10.45, respectively. This manual radio map (MRM) was used for the calibration of automatic radio map (ARM) generation.

The Development of an Automatic Radio Map Using Ray-Tracing
ARM is illustrated in Figure 9. There are 3 types of RSSIs: line of sight, first reflection, and second reflection. Following the above, this ARM was compared to MRM, and the results are shown in Table 8. The proposed system adapt to an altered map by adapting the radio map database. The user create a new csv file based on the altered map as an input as shown in Figure 3. Then the system will generate a new radio map based on ray tracing propagation model using Matlab. At present, the creating of csv files is still manual; in the future, it can be done automatically using image processing. −50 dBm, −40 dBm, and −45 dBm for the RSSI transmitted from AP1, AP2, and AP3, respectively. Following that, the minimum RSSI were −89 dBm, −84 dBm, and −87 dBm. The standard deviations for RSSI 1 , RSSI 2 , and RSSI 3 were 7.1, 11.06, and 10.45, respectively. This manual radio map (MRM) was used for the calibration of automatic radio map (ARM) generation.

The Development of an Automatic Radio Map Using Ray-Tracing
ARM is illustrated in Figure 9. There are 3 types of RSSIs: line of sight, first reflection, and second reflection. Following the above, this ARM was compared to MRM, and the results are shown in Table 8. The proposed system adapt to an altered map by adapting the radio map database. The user create a new csv file based on the altered map as an input as shown in Figure 3. Then the system will generate a new radio map based on ray tracing propagation model using Matlab. At present, the creating of csv files is still manual; in the future, it can be done automatically using image processing.  MSE-RT is the mean squared error obtained using the ray-tracing model, while MSE-MW is the mean squared error using the multi-wall model. Table 8 and Figure 10 show the RSSI error. The MSE-RT was smaller than the MSE-MW, meaning that the ray-tracing model was better than the multi-wall model in predicting RSSI. This is because MW only counted the direct signal between TX MSE-RT is the mean squared error obtained using the ray-tracing model, while MSE-MW is the mean squared error using the multi-wall model. Table 8 and Figure 10 show the RSSI error. The MSE-RT was smaller than the MSE-MW, meaning that the ray-tracing model was better than the multi-wall model in predicting RSSI. This is because MW only counted the direct signal between TX and RX, while RT also calculated indirect signals such as reflection and diffraction. Therefore, the RSSI predictions using RT are more accurate than MW.
Some previous studies on ray-tracing propagation models have succeeded in obtaining results of MAE ranging from 3 to 8.52 [64][65][66][67]. The results of this study showed an average MAE of 2.9-A much better result than the results of the above studies. Other studies used RMSE to measure the error of the system. The average RMSE obtained in this study was 3.67, which is still better than some previous studies that obtained an RMSE above 4 [57,58,68,69]. The accuracy of the RSSI prediction based on the ray-tracing propagation modeling is, therefore, very high.
Sensors 2020, 20, x FOR PEER REVIEW  15 of 26 and RX, while RT also calculated indirect signals such as reflection and diffraction. Therefore, the RSSI predictions using RT are more accurate than MW. Some previous studies on ray-tracing propagation models have succeeded in obtaining results of MAE ranging from 3 to 8.52 [64][65][66][67]. The results of this study showed an average MAE of 2.9-A much better result than the results of the above studies. Other studies used RMSE to measure the error of the system. The average RMSE obtained in this study was 3.67, which is still better than some previous studies that obtained an RMSE above 4 [57,58,68,69]. The accuracy of the RSSI prediction based on the ray-tracing propagation modeling is, therefore, very high.

The Development of RSSI Adaptation
The results of the first experiment are presented in Figure 11. As a comparison, when no people are blocking the LOS, the values of RSSI received by the MD were −45 dBm for AP1 and AP2, and −46 dBm for AP3. It appears that when people bar the signal path between AP and MD and stand in the LOS path, the value of RSSI reduces, especially when the people's positions are close to the MD. The difference in the values of RSSI when there is one person as opposed to no persons (Δ RSSI) is shown in Figure 12. RSSI decreased by an average of 5 dBm when one person was 1 m to 3 m away from the MD. When the distance of the person was 4 m to 6 m, then, the RSSI decreased by an average of 3 dBm. The RSSI further decreased by 1 dBm when the distance of the person was 7 m to 9 m. An average value (5 dBm) was used as the value of the LOS PPE constant, later used in the RSSI

The Development of RSSI Adaptation
The results of the first experiment are presented in Figure 11. As a comparison, when no people are blocking the LOS, the values of RSSI received by the MD were −45 dBm for AP1 and AP2, and −46 dBm for AP3. It appears that when people bar the signal path between AP and MD and stand in the LOS path, the value of RSSI reduces, especially when the people's positions are close to the MD.
Sensors 2020, 20, x FOR PEER REVIEW 15 of 26 and RX, while RT also calculated indirect signals such as reflection and diffraction. Therefore, the RSSI predictions using RT are more accurate than MW. Some previous studies on ray-tracing propagation models have succeeded in obtaining results of MAE ranging from 3 to 8.52 [64][65][66][67]. The results of this study showed an average MAE of 2.9-A much better result than the results of the above studies. Other studies used RMSE to measure the error of the system. The average RMSE obtained in this study was 3.67, which is still better than some previous studies that obtained an RMSE above 4 [57,58,68,69]. The accuracy of the RSSI prediction based on the ray-tracing propagation modeling is, therefore, very high.

The Development of RSSI Adaptation
The results of the first experiment are presented in Figure 11. As a comparison, when no people are blocking the LOS, the values of RSSI received by the MD were −45 dBm for AP1 and AP2, and −46 dBm for AP3. It appears that when people bar the signal path between AP and MD and stand in the LOS path, the value of RSSI reduces, especially when the people's positions are close to the MD. The difference in the values of RSSI when there is one person as opposed to no persons (Δ RSSI) is shown in Figure 12. RSSI decreased by an average of 5 dBm when one person was 1 m to 3 m away from the MD. When the distance of the person was 4 m to 6 m, then, the RSSI decreased by an average of 3 dBm. The RSSI further decreased by 1 dBm when the distance of the person was 7 m to 9 m. An average value (5 dBm) was used as the value of the LOS PPE constant, later used in the RSSI The difference in the values of RSSI when there is one person as opposed to no persons (∆ RSSI) is shown in Figure 12. RSSI decreased by an average of 5 dBm when one person was 1 m to 3 m away from the MD. When the distance of the person was 4 m to 6 m, then, the RSSI decreased by an average of 3 dBm. The RSSI further decreased by 1 dBm when the distance of the person was 7 m to 9 m. An average value (5 dBm) was used as the value of the LOS PPE constant, later used in the RSSI adaptation for the development of AIRY.  Figure 12 shows that the closer the distance of people to the MD in the LOS position, the greater the decrease in RSSI. The closer the people are to the MD, the more the people will block the signal from the transmitter. This case applied to the RSSI originating from AP1, AP2, and AP3.
The results of the second experiment are shown in Figure 13. The RSSI values are still around 48 dBm, i.e., between 47 dBm and 49 dBm. As a reference, the RSSI when there was no one was 47.34 dBm for AP1, 48 dBm for AP2, and 48 dBm for AP3. It can be seen in Figure 11 that when one person was around the MD, at a varied position and distance, the value of RSSI did not significantly reduce compared to the RSSI obtained when there were no people. The average difference in RSSI between the conditions in which one person was around the MD as opposed to no people can be seen in Table 9. Therefore, the further the distance between the people and the MD, the smaller the impact of the people on RSSI. People at a distance of 1 m from the MD reduced the RSSI of the MD by around 0.5 dB. This value then decreased to around 0.4 dB when the distance was 2 m and around 0.3 dB at 3 m. The maximum value (0.5 dBm) was, therefore, used as the value of the NLOS PPE constant, later used in the RSSI adaptation.  Figure 12 shows that the closer the distance of people to the MD in the LOS position, the greater the decrease in RSSI. The closer the people are to the MD, the more the people will block the signal from the transmitter. This case applied to the RSSI originating from AP1, AP2, and AP3.
The results of the second experiment are shown in Figure 13. The RSSI values are still around 48 dBm, i.e., between 47 dBm and 49 dBm. As a reference, the RSSI when there was no one was 47.34 dBm for AP1, 48 dBm for AP2, and 48 dBm for AP3. It can be seen in Figure 11 that when one person was around the MD, at a varied position and distance, the value of RSSI did not significantly reduce compared to the RSSI obtained when there were no people.  Figure 12 shows that the closer the distance of people to the MD in the LOS position, the greater the decrease in RSSI. The closer the people are to the MD, the more the people will block the signal from the transmitter. This case applied to the RSSI originating from AP1, AP2, and AP3.
The results of the second experiment are shown in Figure 13. The RSSI values are still around 48 dBm, i.e., between 47 dBm and 49 dBm. As a reference, the RSSI when there was no one was 47.34 dBm for AP1, 48 dBm for AP2, and 48 dBm for AP3. It can be seen in Figure 11 that when one person was around the MD, at a varied position and distance, the value of RSSI did not significantly reduce compared to the RSSI obtained when there were no people. The average difference in RSSI between the conditions in which one person was around the MD as opposed to no people can be seen in Table 9. Therefore, the further the distance between the people and the MD, the smaller the impact of the people on RSSI. People at a distance of 1 m from the MD reduced the RSSI of the MD by around 0.5 dB. This value then decreased to around 0.4 dB when the distance was 2 m and around 0.3 dB at 3 m. The maximum value (0.5 dBm) was, therefore, used as the value of the NLOS PPE constant, later used in the RSSI adaptation. The average difference in RSSI between the conditions in which one person was around the MD as opposed to no people can be seen in Table 9. Therefore, the further the distance between the people and the MD, the smaller the impact of the people on RSSI. People at a distance of 1 m from the MD reduced the RSSI of the MD by around 0.5 dB. This value then decreased to around 0.4 dB when the distance was 2 m and around 0.3 dB at 3 m. The maximum value (0.5 dBm) was, therefore, used as the value of the NLOS PPE constant, later used in the RSSI adaptation. The decrease in RSSI, in this case, was much smaller than the decrease in RSSI when the people were at the LOS position. This is because the people in the LOS position blocked the direct signal and caused significant attenuation, whereas the people in the NLOS position mainly blocked the reflection signal. The reflection signal power was much smaller than the direct signal.
Both previous experiments discussed the effect of one person around MD on RSSI. The third experiment aimed to determine the effects of many people around the MD on RSSI, ranging from 2 people to 13 people, who had varied positions and distances from the MD-Starting at a distance of 1 m and then proceeding with distances of 2 m and 3 m.
The results of the experiment with a people distance of 1 m can be seen in Figure 14, which explains that the more people around the MD, the higher the decrease in RSSI on the MD; hence, the difference in RSSI of many people compared to no people also increased. The RSSI started to reduce by 0.5 dBm when 2 people were present, and then reached 0.9 dBm with 7 people. The more people around the MD, the more reflection signals were blocked, such that the RSSI value decreased even more.  The decrease in RSSI, in this case, was much smaller than the decrease in RSSI when the people were at the LOS position. This is because the people in the LOS position blocked the direct signal and caused significant attenuation, whereas the people in the NLOS position mainly blocked the reflection signal. The reflection signal power was much smaller than the direct signal.
Both previous experiments discussed the effect of one person around MD on RSSI. The third experiment aimed to determine the effects of many people around the MD on RSSI, ranging from 2 people to 13 people, who had varied positions and distances from the MD-Starting at a distance of 1 m and then proceeding with distances of 2 m and 3 m.
The results of the experiment with a people distance of 1 m can be seen in Figure 14, which explains that the more people around the MD, the higher the decrease in RSSI on the MD; hence, the difference in RSSI of many people compared to no people also increased. The RSSI started to reduce by 0.5 dBm when 2 people were present, and then reached 0.9 dBm with 7 people. The more people around the MD, the more reflection signals were blocked, such that the RSSI value decreased even more. The results of the experiment with people at a distance of 2 m are shown in Figure 15. The number of people ranged from 2 to 10 at varied positions, as shown in Table 6. The average value for the difference in RSSI was almost the same as the results of previous experiments, but the results of this experiment were smaller. The further the people position from the MD, the lesser the impact of the people on the decline in RSSI. The results of the experiment with people at a distance of 2 m are shown in Figure 15. The number of people ranged from 2 to 10 at varied positions, as shown in Table 6. The average value for the difference in RSSI was almost the same as the results of previous experiments, but the results of this experiment were smaller. The further the people position from the MD, the lesser the impact of the people on the decline in RSSI.
The results of the experiment with people at a distance of 2 m are shown in Figure 15. The number of people ranged from 2 to 10 at varied positions, as shown in Table 6. The average value for the difference in RSSI was almost the same as the results of previous experiments, but the results of this experiment were smaller. The further the people position from the MD, the lesser the impact of the people on the decline in RSSI. Figure 15. The effect of many people on RSSI in the 2nd ring. Figure 15. The effect of many people on RSSI in the 2nd ring. Figure 16 shows the average RSSI results of experiments according to the number of people involved. The results were generally the same as the previous experiment, but for the same number of people, the ∆RSSI was smaller than the results of previous experiments. This result shows that the people distance from the MD affected the RSSI received by the MD.
Sensors 2020, 20, x FOR PEER REVIEW 18 of 26 Figure 16 shows the average RSSI results of experiments according to the number of people involved. The results were generally the same as the previous experiment, but for the same number of people, the ΔRSSI was smaller than the results of previous experiments. This result shows that the people distance from the MD affected the RSSI received by the MD. The three experiments above show that the number, the position, and the distance of people to the MD in the NLOS position affected the value of RSSI; the more the people, the greater the influence, and the closer the distance of the people to the MD, the greater the influence.
Finally, the rules of the RSSI adaptation are (see Figure 17 and Algorithm 2) listed below: • If there are people in the NLOS position between the AP position and the initial position, then 0.5 dBm is added to the RSSI.  The three experiments above show that the number, the position, and the distance of people to the MD in the NLOS position affected the value of RSSI; the more the people, the greater the influence, and the closer the distance of the people to the MD, the greater the influence.
Finally, the rules of the RSSI adaptation are (see Figure 17 and Algorithm 2) listed below: • If there are people in the NLOS position between the AP position and the initial position, then 0.5 dBm is added to the RSSI.

•
If the people are in the LOS position between the AP position and the initial position, then 5 dBm is added to the RSSI.

•
Then, if there are no people, the RSSI value does not change.
• If there are people in the NLOS position between the AP position and the initial position, then 0.5 dBm is added to the RSSI.

•
If the people are in the LOS position between the AP position and the initial position, then 5 dBm is added to the RSSI. • Then, if there are no people, the RSSI value does not change. Figure 17. RSSI adaptation process. Figure 17. RSSI adaptation process.

Input:
Initial RSSI, People Location, APs Location, Initial Position Output: Adapted RSSI 1: Get Initial RSSI (Ri)and People Location 2: Get Initial Location and APs Location 3: For each Ri do 4: If (there are no people) then 5: Ra = Ri 6: End I f 7: If (there are people in the LOS position) then 8: Ra = Ri + 5 9: End I f 10: If (there are people in the NLOS position) then 11: Ra = Ri + 0.5

12:
End I f 13: End  Figure 18 shows the steps for checking IPS accuracy. The first step was to create a radio map database. There are 3 types of databases, as explained in the methodology section. The location used for testing was the 3rd floor of Razak Tower, Universiti Teknologi Malaysia Kuala Lumpur.
The RSSI vectors in 65 test points were recorded. At each test point, 30 RSSI data points from AP1, AP2, and AP3 were recorded. A total of 65 sample nodes were used to check the system accuracy. These sample nodes were measured in the online stage using MD. These data were then matched with the radio map databases using the KNN algorithm to obtain a location estimate for the MD/user.
The positioning algorithm used in this experiment is the KNN algorithm. This is because there is a previous research by Iyad that has same technique, same devices and same place (the 3rd floor of the UTM Kuala Lumpur Razak Tower) [48]. Iyad nominated 2 positioning algorithms: KNN and ANN. The results obtained showed that KNN can achieve more accurate positioning results than ANN. The KNN algorithm with k = 3 is chosen because it produces the highest percentage of accuracy. Another reason is because KNN is simpler than ANN. Furthermore, ANN is a complex system that needs heavy computations especially in the training phase, and this complexity does not fit with mobile device limitation. AP1, AP2, and AP3 were recorded. A total of 65 sample nodes were used to check the system accuracy. These sample nodes were measured in the online stage using MD. These data were then matched with the radio map databases using the KNN algorithm to obtain a location estimate for the MD/user.
The positioning algorithm used in this experiment is the KNN algorithm. This is because there is a previous research by Iyad that has same technique, same devices and same place (the 3rd floor of the UTM Kuala Lumpur Razak Tower) [48]. Iyad nominated 2 positioning algorithms: KNN and ANN. The results obtained showed that KNN can achieve more accurate positioning results than ANN. The KNN algorithm with k = 3 is chosen because it produces the highest percentage of accuracy. Another reason is because KNN is simpler than ANN. Furthermore, ANN is a complex system that needs heavy computations especially in the training phase, and this complexity does not fit with mobile device limitation.  The error values of the 65 test points for the ARM-RT database are shown in Figure 19. The maximum errors of the MRM database, the ARM-RT database, and the ARM-MW database were 1.37 m, 1.47 m, and 2 m, respectively. Figure 19. CDF of the the accuracy of the system using the ray-tracing automatic radio map.
The smallest average error (0.62 m) was obtained using the MRM database followed by ARM-RT and ARM-MW, with an average accuracy of 0.97 m and 1.27 m, respectively. The localization error using MRM database is significantly lower than in RADAR (a radio-frequency based system for locating and tracking users inside buildings) [41], by a factor of four (0.62 vs. 2.5 m) because AIRY used more radio map database than RADAR. RADAR collected RSSI vectors at 70 reference points (RPs) for the floor that has dimension of 43.5 m by 22.5 m, and AIRY has 523 RSSI vectors for the floor that has a dimension of 80 × 16 m. The number of RPs has a profound effect on the fingerprint positioning methods. Too few results in inaccurate fingerprint data, leading to poor performance The best accuracy was achieved by the MRM database. However, the MRM database requires more time and energy to construct. The highest average error using the ARM-MW database was 1.27 m, similar to the results of previous studies conducted in the same building by Iyad [48]. A better average error, 0.97 m, was obtained when using the ARM-RT database. The time needed to Figure 19. CDF of the the accuracy of the system using the ray-tracing automatic radio map.
The smallest average error (0.62 m) was obtained using the MRM database followed by ARM-RT and ARM-MW, with an average accuracy of 0.97 m and 1.27 m, respectively. The localization error using MRM database is significantly lower than in RADAR (a radio-frequency based system for locating and tracking users inside buildings) [41], by a factor of four (0.62 vs. 2.5 m) because AIRY used more radio map database than RADAR. RADAR collected RSSI vectors at 70 reference points (RPs) for the floor that has dimension of 43.5 m by 22.5 m, and AIRY has 523 RSSI vectors for the floor that has a dimension of 80 × 16 m. The number of RPs has a profound effect on the fingerprint positioning methods. Too few results in inaccurate fingerprint data, leading to poor performance The best accuracy was achieved by the MRM database. However, the MRM database requires more time and energy to construct. The highest average error using the ARM-MW database was 1.27 m, similar to the results of previous studies conducted in the same building by Iyad [48]. A better average error, 0.97 m, was obtained when using the ARM-RT database. The time needed to create an ARM-RT database was indeed longer than for the ARM-MW database. The generation of ARM-RT took around 25 to 30 min while ARM-MW took only 5 to 10 min to generate. Based on error value, ARM-RT is the most promising choice of all the databases. The accuracy of the RSSI prediction greatly affects the accuracy of IPS. After testing the accuracy of IPS with 3 types of radio maps, the next step involved testing the accuracy of the system when PPE was accounted for.

The Accuracy of IPS Considering the People Presence around the User
The more RSSI from APs affected by PPE, the less accurate the system. As a comparison, the accuracy of the system when there were no people was 0.62 m when using the MRM, 0.97 m when using ARM-RT, and 1.27 m when using ARM-MW. Figure 20 shows the accuracy of IPS when the effect of people around the user in the NLOS position was considered. The presence of people caused a decrease in accuracy of 33%, 44%, and 57% for the affected 1 AP, 2 APs, and 3 APs, respectively. The influence of people present in the LOS position was greater than in the NLOS position. The presence of people in the LOS position caused a decrease in accuracy of 273%, 322%, and 334% for the affected 1 AP, 2 APs, and 3 APs, respectively, using the ARM-RT database.
The paper focuses on the influence of people around the user so that during data retrieval and testing the mobile device (MD) is not held by human experimenter but the mobile device is fixed on a tripod. Based on the experiments, the accuracy of the proposed model is not affected by the phone orientation. However, if the MD is held by a human experimenter, the MD orientation will affect the accuracy because the MD orientation affects the human experimenter's position on MD and access points.
PPE had a significant effect on IPS accuracy. In the worst case, in which the RSSI from the three APs was influenced by people in the LOS, IPS accuracy was reduced by 334%. Hence, the ability of the proposed model (AIRY) to overcome this problem was tested to observe any evidence of improved accuracy.

The Accuracy of the Proposed Model (AIRY)
The ability of the system to overcome the issue of the presence of people in this experiment was examined using 65 testing points. The system targeted accuracy improvements of less than 1 m. The average accuracy in the initial position was 2.04 m. After the RSSI adaptation process, which considered the people effect, a new average accuracy of 0.57 m was obtained, indicating a very The influence of people present in the LOS position was greater than in the NLOS position. The presence of people in the LOS position caused a decrease in accuracy of 273%, 322%, and 334% for the affected 1 AP, 2 APs, and 3 APs, respectively, using the ARM-RT database.
The paper focuses on the influence of people around the user so that during data retrieval and testing the mobile device (MD) is not held by human experimenter but the mobile device is fixed on a tripod. Based on the experiments, the accuracy of the proposed model is not affected by the phone orientation. However, if the MD is held by a human experimenter, the MD orientation will affect the accuracy because the MD orientation affects the human experimenter's position on MD and access points.
PPE had a significant effect on IPS accuracy. In the worst case, in which the RSSI from the three APs was influenced by people in the LOS, IPS accuracy was reduced by 334%. Hence, the ability of the proposed model (AIRY) to overcome this problem was tested to observe any evidence of improved accuracy. The ability of the system to overcome the issue of the presence of people in this experiment was examined using 65 testing points. The system targeted accuracy improvements of less than 1 m. The average accuracy in the initial position was 2.04 m. After the RSSI adaptation process, which considered the people effect, a new average accuracy of 0.57 m was obtained, indicating a very significant improvement in accuracy. The proposed model succeeded at reaching the target of under 1 m accuracy.
The AIRY model requires the knowledge of people's positions around the MD. Outside the controlled experiment, at this time this knowledge can be acquired manually by users. There is a feature in the AIRY apps that can be used by the user to provide the information about people's positions around the MD. In future work, it can use image processing to provide this information automatically based on an image from closed-circuit television (CCTV). The proposed approach tracked the position of people with 3m distance from MD. Then based on people's positions around MD, initial position of MD, and position of APs, the system will determine the position of the people whether in the LOS or NLOS position to apply the RSSI adjustments (RSSI adaptation).
A total of 3 RSSIs were recorded by the MD as emitted by 3 APs. The people influenced each RSSI when they were positioned around the MD in the LOS or NLOS positions. Because there were 3 APs, there were also 8 variations in the position of the people, as shown in Table 10. When the positions of the people against the 3 APs were all in the NLOS, an initial error value of 1.92 m was obtained. When the position of the people against 3 APs was all in the LOS, the initial error value increased to 2.11 m. This is because the influence of people in the LOS position on RSSI was greater than those in the NLOS position. A comparison of the accuracy of the proposed system with that of related works is shown in Table 11. The proposed method using the ray-tracing propagation model and considering the people's presence effect was able to achieve high accuracy (0.57 m). AIRY and Adaptive Indoor Positioning System (DIPS) both used radio propagation and the KNN algorithm. AIRY achieved better accuracy than DIPS, as AIRY used ray-tracing, which focuses on multipath signals and therefore significantly affecting the accuracy of RSSI predictions. Table 11. Comparison of Accuracy with Related Works.

Conclusions
In this paper, an accurate indoor-positioning model based on WLAN fingerprinting was designed and validated. This model addressed the drawbacks of the traditional fingerprint method by generating an automatic RM database based on a ray-tracing model (ARM-RT), an indoor propagation model that considers the multipath effect, and an accurate indoor-positioning model based on the people effect and ray-tracing (AIRY). ARM-RT is the major contribution of this research. It is a solution to one of the main problems in IPS WLAN fingerprinting because RM construction requires a lot of time and energy. RM construction not only focuses on the direct signal from the AP to the MD but also takes into account reflection. The construction of a manual radio map for the 3rd floor of Razak Tower took 8 h, while the automatic radio map construction using ray-tracing only took about 30 min. Also, very satisfactory MSE values were obtained compared to the automatic radio map that used multi-wall models, where 12.19 dBm 2 was obtained for the ray-tracing model and 92.38 dBm 2 was recorded for the multi wall-model. The system accuracy was also very good, which was 0.97 m. The main contribution of this study is a highly accurate positioning system. Such high accuracy was obtained by adding an adaptation process in the initial RSSI. The adapted RSSI vectors were calculated based on initial RSSI as input and considering the presence of people around the initial position. The rules that applied to the adaptation of the RSSI vector were as follows: if there are people in the NLOS position (between the APx position and the initial position), the RSSI value of the APx received by MD was increased by 0.5 dBm (NLOS PPE constant), and if the people are in the LOS position, RSSI was increased by 5 dBm (LOS PPE constant). Then, if there are no people, the RSSI value does not change. The average accuracy in the initial position was 2.04 m. After the RSSI adaptation process, a new average accuracy of 0.57 m was obtained, indicating a very significant improvement in accuracy.
Author Contributions: F.F. and N.A.A. conceived and designed the experiments; F.F. performed the experiments; F.F., N.A.A. and S.S. analyzed the data; F.F. presented the data and wrote the paper.
Funding: This work has been supported by UTM Grant (UTM-TDR 9.2(T1)). Hence, the authors would like to thank Universiti Teknologi Malaysia (UTM) for their support.

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