The particle swarm code was applied to a function in which the optimum ("food source") moves randomly throughout the design space. The particles do not know where the food source is, they only know which particle in the swarm is closest to it and are attracted to that particle. In order to make this work, the inertia had to be increased significantly and the personal-best trust factor for each particle set to 0.
I used Matlab for both the optimization and the animation.
montagdp 10 months ago