Local decision making is governed by a decision-making algorithm which encodes sensing, decision making, movement, grouping and the updating of short-term memory. In simulations with grouping, foragers belong to a particular group, and follow behavior rules that ensure that groups move cohesively through the environment. All foragers are placed in a queue according to the time their action ends. The forager with the least time remaining is next to choose an action and is put back in the queue according to the time its new action ends. In this event-based setup, actions of foragers can overlap in time, and some foragers can complete multiple quick actions (e.g. move) while others are engaged in actions that take more time (e.g. searching for food).