12-10-2010, 04:08 PM
ALGORITHM FOR PSO:
ALGORITHM FOR PSO:
For each particle
Initialize particle
END
Do
For each particle
Calculate fitness value
If the fitness value is better than the best fitness value (pBest) in history
set current value as the new pBest
End
Choose the particle with the best fitness value of all the particles as the gBest
For each particle
Calculate particle velocity
Update particle position
End
While maximum iterations or minimum error criteria is not attained
First we have to randomly assign the number of particles
Velocity of the particle is nothing but the speed of the particle to achieve the pBest and gBest.
In this pBest is the personal best that a particle has achieved and the values will be compared between previous iteration and current iteration and the best one will be updated.
gBest is the global best. It means all the values of personal best are compared and the best one is taken as the global best
Till we get the optimized result we have to run the loop and adjust the values.