| Algorithm 1: Particle swarm optimization |
|
Input: POP, Dim, T, [lb, ub], [vmin, vmax]. |
|
Output: Best_fitness, Best_pos. |
| 1: Initialize population with random positions and velocities within the search space [lb, ub]. |
| 2: Evaluate fitness for each particle |
| 3: Update personal best position (pBest_Pos) and personal best fitness (pBest_fitness) if necessary. |
| 4: Determine if the maximum T has been reached. |
| 5: Update (pBest_Pos) and pBest_fitness based on the best particle’s position and the fitness. Update based on the position and fitness of the best particles (pBest_Pos) and pBest_fitness. |
| 6: Record the best fitness value in the iteration. |
| 7: Update the inertia weight if necessary. |
| 8: Reached cycle count T, ending cycle. |
| 9: Return pBest_Pos and pBest_fitness. |