Skip to main content
. 2021 Jun 17;97:116359. doi: 10.1016/j.image.2021.116359

Table 2.

Pseudocode of GM-CPSO.

-- Determine the parameter values and ranges
-- Assign the first positions
-- Calculate the error or profit
-- Define Xpbest(i)(0) =Xi(0) and Xgbest(0) = best(Xpbest(i)(0))
-- Update the inertia weight vector according to the maximum iteration number (3)
While (iteration < maximum iteration number)
 -- Computation of new velocity and position vectors (1) and (2)
 -- Calculate the error or profit
 If (minimum error or maximum profit is reached)
 -- Save the best particle vector and its fitness
 -- Break
 End
 -- Attain the Xpbest vector for every particle and Xgbest for the entire swarm
 -- iteration++
End