Research Article

Wireless Localization Method Based on AHP-WKNN and Amendatory AKF

Pseudocode 1

The pseudocode of the proposed algorithm.
Input: measured RSS matrix at test point and fingerprint database
Output: the optimal position estimation
1. Initializing the amendatory AKF and AHP, and setting the first column of as the initial value for the in amendatory AKF;
2. ;
3. the number of iterations of the amendatory AKF;
4. whiledo:
 5. setting the threshold based on Equations (21) and (22)
 6. reducing noises of in the tth column of based on Equations (12), (14) and (16) and getting the output ;
 7. calculating the covariance of Equation (18);
 8. comparing with . If , fix to get based on Equations (23) and (24), and use for the next iteration. Otherwise, use instead;
 9. updating Equation (13), (17), (19) and (20);
;
11. end while
12. Calculating the Euclidean distances between and each fingerprint in the database. Sorting these distances and choose nearest fingerprints’ coordinates;
13. Based on and fingerprints, using AHP to build hierarchical model and judgment matrices;
14. Examining the consistency of each judgment matrix and determining the weight vector of each judgment matrix based on Equation (7) and (8);
15. Getting the weights of fingerprints’ coordinates that are needed to realize localization based on Equation (9);
16. Based on the coordinates and their corresponding weights, using Equation (6) to estimate the optimal position ;
17. return.