Discrete-Event Simulator: Particle Swarm

Particle Swarm Optimization (PSO) is a population-oriented stochastic search technique similar to genetic algorithms, evolutionary strategies, and other evolutionary computation algorithms. The technique discovers solutions for N-dimensional parameterized problems: basically it discovers the point in N-dimensional space which maximizes some quality function.

PSO works approximately as follows: a "swarm" of candidate solutions ("particles") are placed randomly throughout the space and with a random initial velocity. Each particle measures the quality of its present location in space. This velocity vector affects how each particle moves in the space, and it is changed each timestep according to a weighted sum of the following values:

The demo visualize the PSO running on the cost function Rastrigin.

The potential field is a Rastrigin function. Particle Swarm will restart randomly every 40 seconds :)