A cellular model of swarm intelligence in bees and robots