This is an application of PSO on two benchmarks that are Rosenbrock and Rastrigin functions. Parameter a, which can be considered as the likelihood of a particle to preserve its position, has been reduced over time for optimal performance. Plots of several generations are shown in figures where black dots indicate the final one. Surprisingly, this old technique has a really quick convergence rate.
Rosenbrock
Rastrigin
Requirements:
matplotlib, numpy