reimplemented PSO solver without dependencies on DEAP