Vectorized general particle swarm optimization code using python.
The code can work with any arbitrary fitness/cost function with arbitrary number of optimization parameters (dimensions). To increase the processing speed, the code has been completely vectorized. All possible parallel operations are implemented using matrix mathematics. Thus, nested loops are avoided. Only a single for loop going over the iterations/generations is used.
Generated using pso_2D_animation_v1.py file.
v1_1:
- Added average fitness and average pbest plots for checking convergence
v1_2:
- The intial variable assignment has been embedded within the loop
- Added elapsed time calculator