Feed people to targets
CLEM.Activities.LabourActivityFeedToTargets
Manages the feeding the family or labour force to target levels.

This activity attempts to feed the people present up to specified targets. It includes a switch to also consider the hired labour in the decisions.
A daily intake limit is defined in this activity. This will define the limit (kg) that people can eat per day. This is required to give the model an upper limit of intake and stop feeding before targets are reached.
The activity can also indicate a mass of food eaten from sources outside of the model process. This will contribute toward the daily intake limit and reduce the food stores that can be consumed.

The following parameters are used to define this activity

The maximum intake allowed per AE per day (kg).

The amount (kg) of daily intake obtained from food sources not included in the model.

This switch determines whether hired labour is included in this feeding activity.

This switch determines whether stores of food types above a reserve limit will be sold.

This parameter points to one of the defined Finance types in the Finance group of the Resources available for this simulation. This entry is a drop down list of available Finance types.
An additional "Not provided" entry is supplied for when selling excess food is disabled (not necessary, but may be needed if no finance resources are provided).

The number of months worth of food to retain as a reserve before selling excess food. The reserve will be calculated from the number of adult equivalents and the target of the first Feed target provided.

This parameter will determine what action is taken if there are insufficient resources to perform this activity.
You can report an error and stop the simulation, skip this activity or use the resources available. See What to do when resources are limiting

The following components are required to use this activity

Any number of Feed target components can be supplied to define each target required.

This activity will use a Relationship defining Adult equivalent as a function of age (months) provided in the Labour resource to calculate intake and targets. If this component is not included all individuals will be assume to be 1 adult equivalent.

The following components will add additional functionality to this activity

A list of Feed target purchase components below with activity will define what food stores can be purchased to help meet feeding targets if no stores are available, there are available farm funds (assuming the food store has a price) and the food store has a transmutation (or ability to create new resource). The sum of the proportions of all Feed target purchase components must add up to 1.

Adding a timer to this activity will ensure that it does not occur every time-step (see Using timers)

This activity is performed during the Get Resources Required event of the setup and time-step events. This is the standard, monthly clock event by which CLEM activities request resources and perform actions based on the resources provided, therefore this activity will compete with most activities in the time-step with their location in the simulation tree determining the order they are processed (this includes activities located on other CLEM and Market components). If this activity relies on another activity having been performed, or other activities rely on this activity in the time-step, ensure it has been performed in the correct order based on it's position in the simulation tree.


The following section outlines how the various food types available are provided for consumption. In reality decisions about what people eat can involve a complex set of rules and decisions. The relatively simple approach used in this activity should allow a range of scenarios to be implemented by the user.
The model tracks of the age of the various pools of each Human food store type and determines whether any pool has reached a set Use by age, indicating the food has spoiled and is not fit for consumption. The consumption rules aim to minimise losses through food spoiling that equates to a loss of valuable resources (unless they can be fed to livestock).
The human consumption process considers the order in which the human food types are provided in the simulation tree (see Importance of component order) with all decisions undertaken from the top of the list downward. This means food types provided at the bottom of the list will be considered last when feeding people and are therefore most likely to be uneaten when sufficient food is available. Therefore, you can determine the order in which food types are eaten. For example, you may place the most valuable food types at the bottom of the list making them most likely to be in excess and available for sale, maximising financial return. Alternatively, you may order the food types in descending order of nutritional content, thus ensuring the best quality food is eaten first and having the best chance of reaching nutritional targets.
The process of assigning food to people.
- The number of adult equivalents to be fed is calculated. (see adult equivalent relationship in Labour)
- The maximum permitted intake for the population (kg) is calculated using the value provided above. This also considers the amount obtained from sources not considered in the model.
- Calculate the total needed and amount from other sources provided for each Feed target provided for this activity
- We next get the list of each individual pool of all food types available ordered by time before used by date (time remaining to eat this parcel of food) and the order provided in the simulation tree. If the food type does not have a used by time (value set to 0), the used by date is set to one month greater than the maximum age of all pools present. If a market is present, all food available in the market is added to the bottom of this list in order of price such that free food is first available after the household supply is exhausted.
- We next step through this list of pools for human food
- if the current population intake is less than the maximum intake and (any of the feeding targets are still not met or the food parcel is expiring this time-step) the population can still eat
- We determine what proportion of the remaining kg to be eaten this pool represents
- We then determine how much would be needed to meet the next unmet target
- The minimum of these two proportions is recorded as eaten and the intake and current levels of each metric are updated
- if we have met our daily intake limit, but there are still unmet targets we look at whether the current pool could substitute another previously eaten pool and gain better nutritional outcomes
- if the current population intake is less than the maximum intake and (any of the feeding targets are still not met or the food parcel is expiring this time-step) the population can still eat
- We next use the proportion of each food parcel consumed in the above process to remove the food consumed from the human food type resources.
- Each food type eaten is recorded in the LabourDietComponent list of each individual
The implications of this method
- If no food type has a best before date, the order of the food types provided in the tree will determine food eaten
- The priority is to eat food about to spoil and be lost from the system
- Food supply in a market associated with the simulation is automatically included.

Human food stores in excess of a set reserve level can be sold (SellExcess switch turned on)
The reserve to be kept is calculated using the first target metric provided and a set number of months worth of reserve. To calculate what food types are in the reserve and what is available for sale the model uses the following process
- Calculate and store the target for each month of the reserve period and create a store to hold amounts provided by this process
- Move through each Human food store type in the order they are provided
- Move through each pool of food for the food type in ascending order of months remaining before expiring (ignoring food expiring this time-step)
- Attempt to place this food in the designated reserve pool or earlier if target not reached. This will ensure that the food is stored and has not expired when needed to be eaten
- Sell any excess that has not been allocated into a reserve pool and receive payment based on the Resource pricing provided for that food type. The purchase rules relating to unit sizes will be obeyed.
The implications of this method
- Food can be sold even if the best before date does not allow for storage across the full storage period specified as there may still be excess to the requirements of the smaller period and selling food is better than allowing the food to spoil.

Additional food can be purchased from stores that implement a transmutation. If a Market is present, purchases will only be available through the market, with pricing based on transmutations provided, regardless of what local stores with transmutation are present.
For each Feed target purchase provided, the food type specified will be purchased to meet the proportion of the remaining target level. This purchase will be limited by available funds as appropriate.
The food eaten will not pass through the local farm stores, but is eaten directly from the market.
See also