Research Article

Localization for Wireless Sensor Networks Assisted by Two Mobile Anchors with Improved Grey Wolf Optimizer

Algorithm 2

Location estimation of
Input: , ,
Output:
1.  the virtual anchor with the largest RSSI in
2.  the virtual anchor with the second-largest RSSI in
3.  If ( satisfying is an equilateral triangle)
4.   
5.  Else
6.   the virtual anchor with the third-largest RSSI in
7.  End if
8.  Get by eq. (26)
9.  
10.  Initialize a grey wolf population in
11.  Initialize , , and by Eq. (14), Eq. (15), Eq. (20), and Eq. (25)
12.  Calculate the fitness of each wolf by Eq. (3)
13.  the best wolf
14.  the second-best wolf
15.  the third-best wolf
16.  
17.  While
18.   For each wolf
19.    Get by Eq. (19)
20.    a random number in [0,1]
21.    If
22.     Get by Eq. (21)
23.     Get the final by Eq. (22)
24.    Else if
25.     Get by Eq. (23)
26.     Get the final by Eq. (24)
27.    End if
28.   End for
29.   Update , , and by Eq. (14), Eq. (15), Eq. (20), and Eq. (25)
30.   Calculate the fitness of each wolf by Eq. (3)
31.   Update , and
32.   
33.  End while
34.  Return