Calculate the fitness of individuals in the population, and record the global optimal position , the global optimal fitness value , the global worst position , and the global worst fitness value .
Iteration: While(t<T)
(1)
Calculate the warning value ;
(2)
for each :
(3)
Update the position of the discoverer with top DP fitness by using (1);
(4)
Update the position of the joiner with the rest fitness by using (2);
(5)
Update the position of the watcher by randomly selecting WP of the individuals by using (3);
(6)
end for;
(7)
Calculate the fitness of the population individuals after the location update and sort them, and calculate formula (7) to eliminate the last individuals in the sort;
(8)
Use (8) to add new individuals to the population to form a new population, and calculate the fitness again;
(9)
If the new position is better than the old position, the old position is updated;