|
Algorithm 1 VASF-PSO pseudocode. |
-
1:
Input: Initialize swarm size, particle velocities (), positions (), search factor (), individual best (), swarm best (), and iteration count.
-
2:
Output: Best fitness
-
3:
Initialize particles using Equation (10)
-
4:
Locate the coverage holes using Equations (11)–(13)
-
5:
for k = 1 to Max Iterations do
-
6:
for i = 1 to swarm size do
-
7:
Calculate the fitness using Equation (4).
-
8:
if fitness < then
-
9:
Update to the current fitness value.
-
10:
end if
-
11:
if fitness < then
-
12:
Update .
-
13:
end if
-
14:
Update the velocity of each particle using Equation (5).
-
15:
Update the position of each particle using Equation (6).
-
16:
Calculate acceleration coefficients using Equations (7) and (8)
-
17:
Update the search factor for VASF-PSO using Equation (9)
-
18:
Repeat steps 1 to 18 until the maximum number of iterations is reached.
-
19:
end for
-
20:
end for
-
21:
Return:, Optimized continuous WSNs deployment.
|