Added support for particle swarm optimization.