An Analytical and Spatial Model of Foraging in a Swarm of Robots