Research Article

A Novel Non-Line-of-Sight Indoor Localization Method for Wireless Sensor Networks

Pseudocode 1

1. Initialize the basic parameters of PSO-C
2. Generate an initial population and its velocities randomly
3. Calculate the fitness values of the population
4. Set S to be the for each particle
5. Set the particle with best fitness to be pg
6. For do
7. For iā€‰=ā€‰1 to M do
8. Update the velocity of particle Xi using equation (10)
9. Update the location of particle Xi using equation (11)
10. Compute the fitness values of the new particle Xi
11. If the fitness value of Xi is better than the fitness values of pbi
12. Then, set Xi to be pi
13. End if
14. If the fitness value of Xi is better than the fitness values of pg
15. Then, set Xi to be pg
16. End if
17. End for
18. End for