Integration of legacy sub-system components into an object-oriented simulation model of a complete pastoral dairy farm
Introduction
This paper describes techniques for integrating existing software models of real-world entities — legacy component models — into a broader object-oriented (OO) simulation framework. As discussed in a preliminary account of this work (Neil et al., 1997, Sherlock et al., 1997), it was advantageous to do this as part of our on-going development of a simulation model of a complete pastoral dairy farm. The work described here is a further development of those ideas, which are clearly applicable to other systems having the same general characteristics as our specific problem.
Pastoral dairying (the predominant dairy production system in New Zealand and parts of Australia and South America) utilises grazed pasture as the principal feed source (Holmes and Wilson, 1987). The major discrete entities are cows (both lactating and non-lactating) and paddocks (enclosed land areas growing pasture herbage for grazing or, less frequently, crops for feed supplements). The basic management goal is to maximise sustainable economic return, and broadly this requires maximising both production and utilisation of feedstuffs. However, the presence of complex feedback loops in a system of inherently complex components makes a predictive understanding of the overall system behaviour very difficult (e.g. overall pasture production depends on the pattern of harvesting, which depends on the pattern of feed demand, which depends on the calving pattern, which depends on the nutritional state of the cows, which depends on overall pasture production). These difficulties are compounded by uncontrollable, and largely unpredictable climate variables (the dominant system inputs) which make unambiguous farmlet experiments virtually impossible to perform.
Numerous component models which simulate aspects of pastoral dairying do exist. For example, the mechanistic MOLLY bovine metabolism model of Baldwin (1995) is extremely detailed and accurate, and is the result of some 30 years of development. However, there is a clear need for a whole-farm system computational model which would allow agricultural scientists to conduct simulation experiments unbiased by uncontrolled variables. Such a model would also minimise the need for (and focus the direction of) costly field investigations — particularly those which centre on management practices (e.g. stocking rates, grazing patterns, supplementary feeding strategies etc.). This framework would support simulation experimentation beyond current normal farm system operational boundaries and provide a basis for automated searches for optimal conditions (e.g. see Mayer et al., 1996, Hart et al., 1998). The development of a whole farm system simulation model should, however, capitalise on the existing models of system components. A primary design goal should therefore be to provide a framework in which the components can be incorporated in a way consistent with the overall design of the model. In this way the whole-farm model should also constitute a repository for the best current description and understanding (expressed in an operational form) of the system components and processes and will also provide a contextual framework for future component model development and refinement. The development and maintenance of such a research model is a long-term goal of this group; preliminary reports have been given by Sherlock and Penno (1996) and Sherlock et al. (1997).
Section snippets
Outline design of a farm simulation framework
Although the major farm components are highly complex dynamical systems, the fact that they are distinct biological entities gives a sensible and natural decomposition of the farm into well-encapsulated ‘lumped element’ sub-systems. Furthermore, the major interactions have the property that (to a useful first approximation at least) they can be described in terms of small subsets of the sub-system state variables, and hence be represented by a relatively simple ‘communication’ between them.
Integration strategies
The following strategies describe the incorporation of existing legacy models (components) into a new more complete OO model (the framework). While these strategies and techniques used are in the context of a Microsoft Windows NT environment, the general principles are applicable for component model integration on other operating systems.
Actual integration procedures using COM specifications
In the development of our FSF, two procedural based legacy components were identified as having functionality required by high level farm objects. A FORTRAN model (McCall, 1984), for which source code was available, contained the functionality for pasture growth, while the ACSL, MOLLY model (Baldwin, 1995), provided the cow nutrition and metabolism functionality. In a previous paper (Neil et al., 1997) we described the integration of these two components using DLL and DDE methodologies
Conclusion
A variety of techniques are available for incorporating component models into an OO framework. In general the interfacing to the component requires a different messaging protocol to that of the framework. Ideally, this difference should be hidden from other objects in the system through using a single proxy object to interface to each instance of the component. The reason for this is twofold; OO programming facilitates development by multiple contributors, each of whom will be familiar with the
Acknowledgements
The authors would like to thank Mike Maguire and Leigh Roberts for their valuable mentoring in the detailed aspects of VisualWorks Smalltalk. This work was supported by the New Zealand Foundation for Research, Science and Technology.
References (20)
- et al.
Optimisation techniques for a computer simulation of a pastoral dairy farm
Computers and Electronics in Agriculture
(1998) - et al.
Use of advanced techniques to optimize a multi-dimensional dairy model
Agricultural Systems
(1996) Microsoft FORTRAN PowerStation. Books Online. Version 4.0
(1995)Microsoft Visual C++. Books Online. Version 5.0
(1997)ObjectShare. VisualWorks Application Developers Guide
(1998)ObjectShare. COM connect User's Guide
(1998)Modeling Ruminant Digestion and Metabolism
(1995)Object-Oriented Analysis and Design
(1994)- et al.
Milk Production from Pasture
(1987) - et al.
The C programming Language
(1988)
Cited by (7)
Simulating grazing beef and sheep systems
2022, Agricultural SystemsCitation Excerpt :In order to simulate ruminant livestock systems, the components of animal genetics (breed), nutrition (forage), management practices and their subsequent impact on the surrounding environment (emissions to air and water) must be considered as a whole in computational models. Several mechanistic process-based simulation models have attempted to simulate the whole system, e.g. the Hurley Pasture Model (Thornley, 1998) and its subsequent revisions - PaSim (Graux et al., 2011), WFM (Neil et al., 1999), GRAZPLAN (Donnelly et al., 2002), GrazeIn (Faverdin et al., 2011), SEDIVER (Martin et al., 2011), e-Dairy (Baudracco et al., 2013) and LiGAPS-Beef (van der Linden et al., 2019). Challenges remain in modelling ruminant systems, due to the symbiotic relationship between rumen microbial anaerobic fermentation and subsequent mammalian metabolism of a combination of derived rumen microbial biomass (microbial protein), fermentation by-products (volatile fatty acids and ammonia) and dietary components which by-pass rumen fermentation.
Incorporating a prediction of postgrazing herbage mass into a whole-farm model for pasture-based dairy systems
2014, Journal of Dairy ScienceCitation Excerpt :This data set was previously used by Beukes et al. (2008) to evaluate the WFM and, therefore, helped to illustrate the adequacy and improvement of the new model development. Details of the WFM and its capabilities have been previously described (Neil et al., 1999; Wastney et al., 2002; Beukes et al., 2008). In brief, in the WFM, animals and paddocks are represented by instances (individual replicates) of the cow and pasture models initialized for each age, breed, and other characteristics unique for each cow instance.
Integrating legacy components into a software system for storm sewer simulation
2006, Environmental Modelling and SoftwareCitation Excerpt :Concepts as well as technologies have been proposed to integrate the legacy models to accurately describe the storm sewer simulation or provide a friendly user interface that makes these models easier to use. The term “legacy component” or “legacy model” is used here to refer to software with older-technology (Lutz, 1995), typically in the form of Fortran subroutines (Ewer et al., 1995; Achee and Carver, 1997; Neil et al., 1999; Tolsma and Barton, 2000; Sang et al., 2002; Guo, 2003). The approaches for integrating legacy components into a software system can be classified into two groups with different levels of difficulty.
Modelling and simulation of ecological propagation processes: Application to fire spread
2005, Environmental Modelling and SoftwareA pasture growth model for use in a whole-farm dairy production model
2003, Agricultural SystemsDecision support for temperate grasslands: Challenges and pitfalls
2005, Utilisation of Grazed Grass in Temperate Animal Systems: Proceedings of a Satellite Workshop of the XXth International Grassland Congress, July 2005, Cork, Ireland