Research Article
Pedestrian Motion Learning Based Indoor WLAN Localization via Spatial Clustering
Algorithm 2
Pseudocode of spatial clustering.
Input: RSS segments | Output: Signal clusters | (1) ; // Initialize the number of RSS clusters | (2) for (each RSS segment ) do // Data traversal | (3) Calculate the -dimensional linear distance between and each of the rest RSS segments; | (4) Save the RSS segments with the -dimensional linear distance smaller than a given threshold, , into set ; | (5) if (the number of elements in is not smaller than a given threshold, Min) then | (6) continue; | (7) else | (8) for (each RSS segment in , ) do // Data traversal | (9) if (the number of RSS segments in is not smaller than the threshold Min) then | (10) Merge into ; | (11) else | (12) continue; | (13) end if | (14) end for | (15) Set as the -th signal cluster; | (16) ; | (17) end if | (18) end for |
|