Simulation of swarm intelligence