input: D (search space), f (objective function) |
output: g (swarm’s best known location) |
hyperparameters:
swarmsize, maxiter, minfunc, ω, ϕp, ϕg
|
begin
|
let
; |
for each
particle ∈ swarm
do set its location as the best known position; |
let
p: each particle’s best known position
|
for
to
maxiter
do
|
for
particle ∈ swarm
do
|
let
x, v, p as the particle’s position, current velocity, best known position; |
let
; |
; |
; |
if
f(x) < f(p) then
; |
end
|
; |
end
|
end
|