Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Algorithm
1. For each particle i=1 to s do
Initialize the particles position with a uniformly distributed random vector
Xi=U(blo ,bup) where blo is lower boundry of search space and bup is upper
boundry of search space.
Intialize best known position of particle to its initial position: pi xi
If (f(p) < f(g)) update the swarms best known position: g p
Initialize the particles velocity: v ~ U(-|bp-bl|, |bp-bl|)
2. Until a termination criterion is met i:e iterations are performed
For each particle i=1 to s do
Choose random number: rp,rg ~U(0,1)
For each dimension d=1 to n do
Update velocity of particle
Vi,d vi,d p rp(pi,d - xi,d) +g rg(gd xi,d)
Update best known position of particle xi xi + vi
If (f(x) < f(p)) do:
Update the particles best known position p x
If (f(p.) < f(g)) update the swarms
best known position: g p
3. Now g holds the best found solution.