Major upgrade 2025

Update February 25: Final checking and validation of the new animal growth component with fat and protein tracking for cattle and sheep is almost complete. Sheep parameterisation and checking remains.

Update October 24: We are now checking the simulation results against a range of models and trial performance data in sheep. Wool production has been added and sheep now work in the new growth models. A detailed assessment of the features between models and the functional difference between fundamental modelling approaches such as energy driven, versus including protein limits.

Update July 24: We are currently updating the example simulations while undertaking further validation and sensibility testing. Due to the upgrade and version approach used in APSIM we are unable to publicly provide a beta release of the changes for testing. Once released, the 2025 Major Upgrade will be included with APSIM.

While we have aimed for full backward compatibility and retained all previous components there have been code changes throughout that may affect your simulations and settings.

Some automatic updating of your simulation files will occur when first opened in the new version and new parameter components will need to be added for ruminants.

If you are currently using CLEM for critical projects we recommend you refrain from upgrading beyond 2024.07.7548 until you have the resources to confirm the new version is working with your simulations.

We are committed to addressing any issues arising from the upgrade and request you raise these through the APSIM Git Repository and mention "CLEM" in the issue title or description.

While CLEM was developed to address the limitations of the two precursor models and consider the future requirements of users, there were limits to the scope of functionality provided in the initial release. Several improvements have been identified as needed to explore the most pressing areas of research in livestock and farm modelling. With assistance of experts in modelling animal physiology we implemented ruminant energy relations and growth using the best practice Australian Feeding Standard equations (based on Freer et al., 2012 and recent research). During this significant process we took the opportunity to address many other outstanding issues that required modifications to the core functionality of CLEM and provide one large upgrade that will provide a strong foundation upon which users can further develop CLEM in future.

This latest upgrade (XXXXXX) will improve the following aspects of CLEM:

  • Ruminant energy and growth

    • Improved crude protein modelling from feed quality to growth limitations of animals.

    • Include tracking of animal protein and fat stores to best define animal condition.

    • Birth weight is now a function of mother’s condition and energy available through pregnancy.

    • The original Grow ruminants activity (using SCA 2007 equations) is still available and works on all new time-steps.

    • Tracking of nitrogen losses in faeces, urine etc. to be available for green house gas emissions calculations.

    • Ability to consider energetics of grazing and mustering (requires some research and discussion).

  • Allow for a time-steps shorter than monthly.

    • Reflects the actual number of days in each month and leap years.

    • Date-based recording of animal life events (birth, conception, weaning etc.)

  • Improved ability to provide quality of feed and feed types considered in animal production.

    • New quality parameters included for all feed types.

    • Categorises feed into concentrates, silage/hay, tropical pasture, temperate pasture, and milk.

  • Growth and mortality separated into individual activities.

    • Apply base mortality, condition-based mortality, or the original CLEM mortality to specified individuals or at specific times. This will begin to facilitate the ability to apply predation, disease etc.

    • Provides greater transparency regarding what mortality is being used.

  • Enteric methane moved to individual activities

    • Added Charmey (XXXX) equation as first component.

    • Easily add other approaches to calculating enteric methane.

    • Removes wayward methane store parameter from Grow Activities.

  • Improved management of ruminant breed and individual properties.

    • New ruminant Parameters Holder and sub-groups in simulation tree.

    • Full validation check to ensure all parameters are provided for the activities included in simulation.

    • New ruminant information property holders (Energy, Lactation, Products, Weight) allow easier searching for properties.

    • Categorised parameter components to now allowing the ability to modify the parameters of individuals and phenotypes.

  • Improved features behind the scenes

    • Better reporting of required units

    • Better validation and new issues handled.

Wherever possible we have tried to maintain compatibility with current simulations but given the extent of the changes made it may not be possible to exactly reproduce previous simulations. While we aim to make the changeover as simple as possible it was not feasible to create tools to fully automate the process, so changes will be needed to your simulation setup and may require editing the apsimx file (JSON text format). We consider this inconvenience justified based on the significant improvements offered for those modelling livestock grazing systems and the new ability to seamlessly provide new functionality in future.

Flexible time-step

CLEM was developed using a monthly time-step as used in the previous models. This relatively large time-step was considered practical and applicable to most management decisions used across small-holder mixed farms and northern Australian grazing systems. It minimised the complexity required during model setup, the input data required, and reduced the computational demand of simulations with large herds (e.g. 10,000 plus head). The new ruminant energy and growth calculations from (Freer et al., 2012) were developed based on a daily time-step and this step was requested for implementing the new Grow ruminants (Protein and Fat) activity and for testing and validation against feed lot weight gain data.

Adding a custom time-step was always envisioned for CLEM, but this was not a trivial task given the simplified approaches that could be made working with a monthly time step. Many aspects of CLEM were affected by this change, mainly relating to the user’s ability to specify the timing of activities, the storing of timing of actions, and the calculation of age in individual ruminants and people.

Activities supporting new time-steps

The new time-step approach applies the specified time-step to the entire CLEM simulation (see CLEM Events section) such that all code responds to the same time-step. The timing of activities at broader time-steps will still be performed by Activity Timers.

Each resource and activity will be assessed to determine whether it handles sub-monthly time-steps. All CLEM components are set to assume a monthly time-step such that previous simulations will continue to run. As each activity is assessed and updated a minimum time-step attribute is assigned. At present this includes the animal growth and breeding components and some associated helper components. All simulations will throw a validation error and stop the simulation if activities are included while using a time-step they do not currently support.

New CLEM Events Component

A new CLEM Events component is now required for all CLEM simulations and must be provided as a child of the APSIM Clock in the simulation (will automatically be added when first opening your simulation). This component is responsible for managing all CLEM events and is where the time-step to be used is specified. This component removes the numerous CLEM events and code from the APSIM Clock which added clutter when accessing Clock properties and events from reports, experiments, and manager scripts.

The time-step can be selected from defined options of monthly, fortnightly, weekly or daily, as well as a custom step where the interval is supplied as days.

Timing of life events

This section is currently a work in progress.

The daily interval of CLEM is now user defined and this means that some of the ActivityTimers that assume months are no longer compatible. The model now tracks the start and end of each time-step and Timers need to define these time-steps to determine when tasks are performed. We now also require rules to define when during a time-step, or multiple time-steps within a Timer conditions, the action is to be performed. Some Timers such as Date range timer will work with the new date-based simulation, while others such as Pasture level timer and Ruminant level timer do not need clock details. However, a new approach for other timers such as Month range timer and Interval timer will need to be defined so that an Activity can be performed in the desired time-step that can easily be defined by the user. Other models face this challenge and often turn to day of the year index, but this is not an intuitive value to understand for most users and so better tools for defining time will need to be developed.

Specifying the age of individuals

Many model properties that tracked time and age previously used counts of months passed (assumed 30.4 days per month) as an index count during the simulation. This is no longer an option when allowing custom time-steps. This applied to many of the age-related properties of the Individual ruminant in CLEM as well as tracking timing of critical occasions of an individual such as birth, purchase, weaning, and breeding events such as conception and time of births. The timing of such events is now based on time-stamps recorded at the time of the event using the simulation clock with new methods (of the Ruminant) to calculate TimeSpan and Days since the last event. This provides much greater flexibility and ease of reporting. The age of an individual now tracks the days (double) since birth and all age-related calculations now need to work in units of days.

Any of the properties where the age of an individual or age at which something occurs will need to be specified by the user in days. Like the day of year metric, specifying age in days when greater than a few months (90 days) or annual increments (365 days) is not always intuitive to set or read, as was also the case when setting older individuals in months (e.g. 7.5 years old needed to be 90 months). For this reason, a new AgeSpecifier property type has been created and applied to all age related properties. This allows the user to specify age in years, months and days (#y,#m,#d format) with the total day equivalent being calculated by the model. The parts provided are flexible from years only (e.g. 2,0,0 for two years), month only (6,0 for six months), or only days (e.g. 72 would be 72 days). Any combination of years, months and days can be supplied with the stipulation that all lower values are provided even if with zero. For example, one year, eight months and three days would be 1,8,3 and this would be assigned approximately 608 days or may be slightly different depending on the months included and the calendar year including leap years.

New Ruminant Growth Activity (SCA)

A new ruminant growth activity (Grow ruminants (Protein and Fat)) based on an updated Australian Feeding Standard equations (Standing Committee of Agriculture, 2007) by Freer et al (2012) is provided in addition to the previous growth activity (Grow ruminants).

The growth functionality offered by Grow ruminants was also base upon the earlier (2007) approach. The general style of the new activity is identical, indicating the aligned approach of the two activities, with different equations included. CLEM had already used normalised weight as a means of predicting the expected size of individuals and tying this to the calculation of energy use and growth.

New breed parameters

With the model now containing multiple versions of activities such as Ruminant Growth it was necessary to better manage the properties relating to the ruminant breeds and ensure duplication was avoided and only the properties needed for a simulation were included. To achieve this the ruminant properties have been moved from the Ruminant type component into individual parameter files that are placed in a Ruminant parameters holder as a child of the Ruminant type in the simulation tree.

The breed specific parameters are now also grouped by general, grow, growPF, breeding, lactation, and grazing categories. The model now ensures new activities can be added in future and the properties relating to the activity easily supplied. As functionality is depreciated or updated it would also be useful to not include or hide the related properties no longer needed.

Some of these new or relocated parameters will be pre-populated with Bos tarus values when the component is added to your model. Full parameter sets defined for other breeds will be provided in the example files with this upgrade.

New Ruminant properties and stores

There has also been some consolidation of properties into groups to simplify finding values to report. This applies especially to the Ruminant, RuminantMale and RuminantFemale objects. Where the property name and some grouping in the user interface was used previously, these properties will now be contained below a parent property. These RuminantInfo classes also contain a range of methods and calculated results available to developers. This assists with finding values when using the APSIM IntelliSense in reports, manager scripts and experiment factors.

Energy

All energy stores tracked during the simulation are stored in the Energy Info holder (individualRuminant.Energy). These include standing stores such as energy from intake, for maintenance, for basal metabolism, for HP viscera, used to move, used to graze, total for grazing (move + graze), for fetus and conceptus, for lactation, for wool, as well as calculated values such as available after pregnancy, lactation and wool are accounted for. Totals available for gain are also provided along with calculated efficiency parameters of kg, km, kl for reporting. This store also has the energy used for protein and fat production as well as the change and previous store value.

Weight

The Weight Info holder (individualRuminant.Weight) tracks and stores all weight related details of the individual. This includes tracking items that provide the current weight, last change amount and previous amount. These tracked weights relate to protein, fat, and base weights, and for females, conceptus, fetus, fetus fat, and fetus protein, and wool for sheep and goats. A range of other properties provide calculated values of live weight, empty body mass, gain, previous weight, empty body mass change, highest weight attained, weight at birth, proportion of high weight. This section also provides the individuals adult equivalent, normalised weight for age, standard reference weight, relative condition and body condition score. This also provides the functionality to implement adding weight to an individual in the code.

Lactation

Lactation related stores such as milk production, potential, actual, available, milked, suckled and milk protein are stored in the Lactation Info object.

Products

This groups includes the outputs provided by the individual such as manure, urine, and associated chemical content for calculations of methane and nitrogen emissions.

Ruminant intake and feed

The new ruminant growth activity (Grow ruminants (Protein and Fat)) allows for much better representation of feed quality and types. This means that concentrates can be fed to the animals with better outcomes of the animal’s energy and growth. To achieve this the ruminant intake section was updated along with the properties required to describe the quality of each feed type.

Improved intake tracking

The Ruminant Intake component is an internal property of each ruminant and is used to track the intake and mixing of all items fed to the animal in a time-step. It also provides feed related values to other parts of the model. These include the energy density and metabolisable energy from both solids and milk intake, as well as dry matter digestibility, nitrogen content and crude protein. Values associated with rumen activity are also provided including rumen undegradable protein, indigestible undegradable protein, rumen digestible protein required, and digestible protein leaving the stomach. This section also provides methods to add feed, and adjust feed based on the quality of intake.

All feed is tracked by Food Resource Stores and Packets.

Food Resource Store

Each animal will have one or multiple Food Resource Stores depending on the type of feed provided. These stores divide the incoming feed into Hay/Silage, Temperate pasture, Tropical pasture, Concentrates, and milk, and track the mixing of each store as feed items are added by Feeding or Grazing activities. They provide the Ruminant Intake component with the current crude protein, degradable crude protein, and digestibility undegradable protein based on feed types, as well as metabolisable energy and fermentable energy.

Food Resource Packet

The Food Resource Packet represents a parcel of feed of given type that is used by the model. These packets follow the CLEM Feed Interface to describe the quality and quantity of a feed. This interface is applied to the GrazeFoodResourceType and AnimalFoodStoreType ensuring they all provide the details needed for the new ruminant energy relations.

Each Food Resource Packet must provide the type of feed it represents. This is where the user will specify concentrates, versus silage and hay, verses pasture. Each packet also defines the gross energy content which was previously assumed constant for all feed (RuminantActivityGrow.GrossEnergy), as well as metabolisable energy content, dry matter digestibility, fat content, nitrogen content, rumen degradable protein content, acid detergent insoluble protein, and an amount.

Depending upon the feed type the user will be present with option of how to provide crude protein content as a value or calculated from nitrogen content.

Each food packet also has methods to determine degradable protein and metabolic energy content from the feed type specified.

This new approach means greater detail is required for all feed types provided in the model. Most of the values can be obtained from feed quality sheets and a range of common feeds will be provided in the grazing example with CLEM.

Solids daily

This is a ExpectedActualContainer which allows the code to track the amount of solid intake expected by the individual as well as the amount received, and the final actual amount achieved. It can also provide feeding activities the amount still needed to satisfy the individual and report the proportion achieved as well as convert from daily amounts used in all calculations to the total amount across the time-step...

Milk daily

This is the same as the Solids daily container but represents the milk intake of sucklings.

Ruminant Mortality

Ruminant mortality was previously handled along with growth in Grow ruminants and the number of options and settings were getting cumbersome with a transparent understanding of the animal death performed difficult to follow.

Animal death has been moved to separate activity (Ruminant death) to be placed below the Growth activity used. This activity has a range of special Ruminant Groups which are used to specify the individuals upon which to consider a type of mortality and the settings required.

Animal death is supplied as a daily rate, so annual mortality rates will need to be converted into daily rates.

Any number of the following Ruminant Groups can be supplied, with mortality across multiple death activites additive, while the code ensures each individual is only considered once within each activity.

Ruminant death group

This Ruminant Group provides the mortality functionality originally provided in CLEM with a base mortality (provided in the RuminantParametersGeneral or RuminantParametersGrowPF depending on the growth model used) for the breed modified by animal condition with the mother’s condition influencing the suckling offspring. This detailed approach with a range of equations and parameters required can be replaced using two death activities and the other death groups however the results will be additive rather than a modification of base rate, which may be more representative.

Ruminant death by rate

This Ruminant Group applies a set mortality rate to the specified individuals and would be used alone to represent a base mortality rate for the entire herd. This could also be used to apply an additional mortality rate to a specified group of individuals such as unvaccinated.

Ruminant death by condition

This Ruminant Group applies a set mortality rate based on a animal condition metric and a cutoff value. Any individual less than the cutoff will have the mortality rate applied to determine if it died. The styles provided include proportion of max weight, relative condition and body condition score.

Prenatal mortality

The prenatal mortality rate is being depreciated and it is suggested it is set to zero while remaining. This setting resulted in monthly fetal mortality and death at birth. The SCA methods do not include this mortality and the new energy relations of pregnancy will allow a better mortality to be applied at birth and to sucklings based on condition. The previous value effectively reduced birth and weaning rate by a set amount on top of the conception rate. It was included to ensure birth and weaning rates were correct from conception rates.

Ruminant Emissions

Ruminant emissions were previously handled in Grow ruminants. In order to allow for various emission calculations in future these actions have been moved to new activities.

Ruminant Activity Enteric CH4 Charmley

This activity calculates the enteric methane emissions based on the Charmley equations and sends this to the appropriate Graze food store type for reporting.

Where we're at

  • Sheep have been parameterised with new wool production and we're currently validating the new growth components with feeding trial data.

    Previous simulations will still run on a monthly time-step with the updated ruminant parameters.

  • Age entries will automatically be updated when you open an old simulation in the new version.

  • Grow ruminants (Protein and Fat) and Grow ruminants (SCA'07) (only for growing individuals) are now included.

  • Ruminant growth and breeding have been checked at a daily time-step, but more work is needed on Manage ruminants.

Still to do

  • Improve and update some Activity Timers to facilitate the selection of sub-monthly timing.

  • Finalise the inheritance and tracking of parameter values for individuals.

  • Improve access to Properties in FilterByProperty.

Getting your simulations running in the new version

1. Ruminant parameters - add predefined breed to simulation and modify to farm settings.

2. Age of ruminants - should be automatic.

3. Reorganised property locations affect

a. Reports

b. Property filters

4. Selection of Grow component to use

5. Add Ruminant death activity

6. Add Ruminant enteric methane activity