## 4 Simulations
### Performed Simulations  
The proposed system was simulated in an apartment consisting of few rooms. The simulations consisted in generating a set of simulated measurements for points distributed along two different test paths. It was assumed that the person was walking with a speed of 1.2 m/s, which is typical for the adults. The BLE RSS values and distances were measured five times per second. The layout of the apartment, the placement of the system infrastructure and both of the test paths are presented in Figure 3.  
The BLE system infrastructure consisted of nine anchors distributed in the apartment. They were placed in such a manner that in each of the rooms, at least one anchor was present. The anchors were  
Figure 3: System layout and test paths used during the performed simulations. (**a**) scenario 1 (**b**) scenario 2.  
fixed to the outer walls, which allowed to evenly cover the whole apartment. The number of used proximity sensors was different in both scenarios. In the first simulated scenario, the user walked from room 1 to room 3 and then visited the kitchen, where he stood in front of the gas stove for 10 s, then he came back to room 1. In the scenario, five ranging sensors were used, two were placed in room 1, two in the corridor and one in the kitchen covering the area in front of the stove. The second path included other rooms. The user started from room 1, then visited rooms 2 and 4 and went to the bathroom, where he stood in the shower cabin for 10 s. After that, he returned to room 1. In this experiment, nine proximity sensors were used, the first four were located in room 1 and the corridor as in the previous scenario. Additionally, two were placed in both bathroom and room 2 and one in room 4. The localization results obtained for the first and second scenarios are presented in Figures 4 and 5, respectively. The accuracy of localizations calculated based on BLE RSS results only varies in the apartment. It is highest in the middle parts of the flat, whereas in the border rooms, the errors are significantly higher. It results from the fact that the signals transmitted from the tag located in those rooms propagate through multiple walls, which introduce significant attenuation. The obtained results are accurate enough to determine a room where the person is located, but nothing more. Using ranging sensors allows to improve localization accuracy in the border rooms, as well as in the corridor. As it can be seen, in case of a loosely coupled algorithm (Figure 4b) the system detects the prolonged presence in front of the gas stove. Results obtained with the tightly coupled version are less accurate (especially in the situation, where the results from only one proximity sensor are available). Figure 4: Scenario 1 results obtained with: (**a**) loosely coupled hybrid algorithm, (**b**) tightly coupled hybrid algorithm with BLE-based localization results as reference. In the second scenario, similar results were obtained. BLE-based localization accuracy is low in places, from which the tag transmitted signal propagates through multiple walls. In case of localization in the bathroom, where the propagation to all of the anchors occurs under NLOS conditions, it is difficult to determine the room where the user is located. As in the previous example, using ranging sensors allows to significantly improve localization accuracy. The results from both algorithms allow us to say that the user spent some time in the shower cabin. For tightly coupled algorithms, it was also observed that fusing BLE RSS with only one distance measurement might not be enough. Localization accuracy in room 4 is much lower than in case of the bathroom or the corridor, which are covered by two sensors. The localization methods can also be compared by analyzing localization errors defined as the Euclidean distance between the calculated localization and the point, where the simulated user was present. A convenient way to do that is to use the Empirical Cumulative Distribution Function (ECDF).