The energy budget is determined by (i) energy gain due rewards from food intake which depends on learning at every DIGESTIONTIME, (ii) a per minute energy metabolism cost (METABOLISM, see Section 1 in Additional file 1), and (iii) an energy costs of 5000 for a reproduction event, which represents a substantial part of total energy. Energy accumulates if energy intake from food exceeds metabolism and reproduction costs. A limited stomach capacity and digestion intervals were added to the model to ensure selective foraging, as is typical for primates and as was assumed in previous models [21, 24]. In addition, an explicit metabolism cost, ensures that there is a viability constraint in the model, where foragers must gain enough energy from food otherwise they die.