Documente Academic
Documente Profesional
Documente Cultură
rand (0, 1) (pbest
i
- X
i
k
) + C
2
rand (0, 1) (gbest - X
i
k
) ----- (1)
P
i
k+1
= P
i
k
+ V
i
k+1
----------------------------------------------------------------------------------- (2)
The following flow chart depicts the general PSO algorithm.
Algorithm
The following are the steps involved in the PSO
Step 1: Initialize the algorithm parameters like w, C1 and C2.
Step 2: Initialize the population of particles position within their upper and lower bounds
Step 3: Initialize the velocity for each particle
Step 4: Calculate the fitness (Objective function value) of each particle
Step 5: Assign all the population as personal best and best of personal best (the vector
corresponds to best fitness) as global best.
Step 6: Update particles velocity using equation1 and position using equation 2.
Step 7: Find the fitness of the updated particles position.
Step 8: If the updated particles position has better fitness than the previous particles
position, update personal best otherwise retain the previous personal best and
best of personal best (the vector corresponds to best fitness) as global best.
Step 9: Repeat step 4 to step 8 until maximum number of iterations.
Step 10: Output global best as result.
Advantages
Compared to GA, the advantages of PSO are that PSO is easy to implement and there
are few parameters to adjust. PSO has been successfully applied in many areas:
function optimization, artificial neural network training, fuzzy system control, and other
areas where GA can be applied.