Algorithm 1. Simple particle swarm optimization (PSO) pseudocode. |
1. begin 2. initialize 3. for i in n_iterations = k 4. for each position p of particle compute fitness 5. if fitness (p) > fitness (pbest) 6. pbest = p 7. set best of pbest as gbest 8. update particles velocity and position 9. gbest is our result |