An energy-aware algorithm for large scale foraging systems