Skip to main content

Module particle_swarm

Module particle_swarm 

Source
Expand description

Particle swarm optimization (Kennedy and Eberhart, with Clerc’s constriction coefficients).

See the book entry Stochastic global optimisation.

Structs§

ParticleSwarm
Global-best particle swarm optimization. Each particle moves with velocity v ← w v + c₁ r₁ (p_best − x) + c₂ r₂ (g_best − x) (r uniform per coordinate), using Clerc and Kennedy’s constriction values w = 0.7298, c₁ = c₂ = 1.49618 by default. Velocities are capped at the box width and positions clamped into the box (which needs finite bounds). Stops when the best value has improved by less than the tolerance (default 1e-12, relative) for stall_iterations iterations, or after the maximum (default 2000).