Trophallaxis
Trophallaxis is the process where the food acquired by foragers is shared within the ant community.
It is based on three steps:
- computing the amount of food acquired by the foragers
- computing the amount of food required by the colony
- distributing the food among the individuals
Here are more details on these steps:
Derivation of available food supply
First, it is computed how much food/energy is available to share among the rest of the colony. This is done via the following function:
RISKANT.Core._calculate_forager_excess_food — Method
This function gets the total excess food of foragers to be distributed to all other ants. This is all the food a forager has acquired, minus a small reserve so that the forager itself can survive the next days (configurable).
Demand computation
First, the demand of each ant type (nurses, larvae, queens) is computed. This is done as follows:
RISKANT.Core._calculate_colony_nurse_food_demand — Method
Calculates the total food demand of all nurses. Each nurse has itself a food_capacity_nurse_max attribute. A nurses demand is the difference between the current energy level and this maximum capacity. This ensures, that a nurse also has a little buffer of energy.
RISKANT.Core._calculate_colony_queen_demand — Method
A queen's demand for food is based on the difference between its current energy level and its desired energy reserve plus the cost of energy required to lay eggs
RISKANT.Core._calculate_food_demand_larvae — Method
Larva also want to have a certain configurable amount of food reserve
RISKANT.Core._calculate_care_demand_larvae — Method
Certain amounts of energy are required to feed the larvae. This depends on the number of larvae and the amount of nurses that are required for each larva. (Default: 10 nurses for a larva)
Food distribution
First, the queens' food demand is satisfied (if possible). If there is food left to be shared, it is distributed within the colony based on the following function:
RISKANT.Core._distribute_energy_to_ants_proportional! — Method
Distributes energy proportionally based on individual need. Ensures all ants receive the same percentage of their energy gap when supply is limited.