Modelling of technological processes in a dairy cattle herd

. The paper presents a model of a technological processes in cattle herd. The concept of developing a model and its implementation was presented in a computer program. It was assumed during construction of a model that the herd consists of particular animals in different age, condition, and which function partially independently from each other. Various events influence a behaviour of model components, including random events which occur with a specific probability. For those units, in the time function detailed rates are calculated. A group of units forms a herd for which group rates are calculated. The developed theoretical model was implemented in the computer program SegaeM which enables calculation of rates which describe a herd and visualization of changes that take place in time. the born calf or age of the purchased cow. Random variables are generated with an assumed probability, which may be respectively modified. Other variables are calculated with the use of mathematical formulas and developed algorithm (including, inter alia, loop statements, interactions, and conditional instructions). Values of indices obtained for each object are calculated into values for the entire herd and as a result for the entire farm. Detailed values of variables in each iteration (calculation day) for a herd and single animals are collected in a table. It gives an opportunity to make a detailed analysis, lists, graphs, and search for trends.


Introduction
Modelling is a process which aims at investigation of the surrounding reality by creation of models [1]. The model reflects objects existing in the real world [2]. Each model includes a simplification and the purpose for which it was created determines its precision of mapping, technique, and technology in which it was created and functions which it must exercise [3] [4].
Among the models of cattle production described in literature, there are models which are a part of management strategy of entire farms, models that deduct a herd of cows and models of single animals. Literature also provides exemplary models which include issues of cattle production [5] [6]. Many authors have dealt with modelling in animal production and the models include various areas related to animal production, which include milk production, meat production, animal health [7] [8]. Publications often include descriptions of reproduction models [9]. Due to the specificity of animal production in case of modelling a cattle herd dynamic models are of significance [10] [11].
The aim of the research was to develop a model of technological processes taking place in a cattle herd. The presented model of processes in a dairy cattle herd was implemented in the computer program. The working model may serve for calculation of many rates which * Corresponding author: michal.cupial@urk.edu.pl characterise the cattle herd. The results are obtained in relation to assumed input assumptions.
Publication was financed with a grant from the Ministry for Higher Education for statutory activities..

Assumptions for developing a model
For developing a model of a herd, it was necessary to accept relevant assumptions. The concept assumes that the herd consists of single elements (objects) which may include cows, cattle, bulls, heifers and in calf heifers. The sum of composing elements is for the entire herd, this, in turn, constitutes a basic element of the ecosystem, namely a farm. The selected models of the cattle herd were presented in table 1. Variables which result from calculations in a model may concern a single animal or the entire herd. They are calculated in other iterations according to appropriate algorithms and may result from various events. Events that influence the course of calculations may result from meeting some conditions or random events. For random events, a probability that a given event will take place is determined for random events.
Technological processes related to handling of animals are an essential element in case of modelling of a cattle herd. Application of modern production technologies forces out a need to use various machines and devices. Calculation of work expenditures of people and machines is necessary for calculation of costs and other indices that characterise the production. In relation to the used machines and devices and production technologies, work expenditures and particular persons and machines may be computed with the use of relevant conversion factors. These factors may be referred to single cows or to a cattle herd treated as a whole. Similarly, as in case of other elements of the model, also work expenditures may be calculated for particular days in the year.

Model construction
Calculations of output indices of the model take place in further iterations for subsequent days. Fig. 1 presents a simplified diagram of UML activity.
Basic values of variables for each item in the herd are calculated in each iteration. As a result of various events (including random events) value of selected variables changes. Additionally, a type of a particular object may change. For example, after a relevant age is achieved, a calf becomes a heifer, after calving into a heifer in calf and then into a cow. New objects may occur in the herd, to which born calves or purchased cows belong. The selected data which characterize new objects introduced into a herd may be randomized. It concerns for example a sex of the born calf or age of the purchased cow. Random variables are generated with an assumed probability, which may be respectively modified. Other variables are calculated with the use of mathematical formulas and developed algorithm (including, inter alia, loop statements, interactions, and conditional instructions). Values of indices obtained for each object are calculated into values for the entire herd and as a result for the entire farm. Detailed values of variables in each iteration (calculation day) for a herd and single animals are collected in a table. It gives an opportunity to make a detailed analysis, lists, graphs, and search for trends. Next, the use of fodder by a herd and, depending on the assumed technologies, energy expenditures, human work expenditures as well as equipment incurred for handling a herd may be calculated. In this case, a part of variables should be calculated for single objects, other, on the other hand, referred to the entire herd or a farm.

Implementation of a model in the computer program
The developed theoretical model was used for creation of computer application. The program was written in Delphi and besides the calculation part it also includes a graphical part, which presents an effect of calculations for a user in a friendly manner. Graphical elements and animations that occur in a program also serve for controlling the program functions. An exemplary screenshot was presented in fig. 2. The program enables setting and change of fixed input parameters which influence the calculation of the herd model. In tables, results of other calculations are presented respectively for the herd (main program window) and for single cows (additional window). The program enables changes of the speed of calculations, calculations may be stopped any time to analyse the data or change the parameters. The program may cease calculations also after some events occur, for example sickness of a cow. In such case (in relations to settings) the program may require a user's decision to undertake the treatment. Any time, the results of calculations may be recorded in csv file which will enable easy export of data to the spreadsheet. In such case analysis of data is possible with the use of pivot tables that enable selecting information on a single animal or a particular day.

Conclusion
The paper presents a dynamic model of a daily cattle herd. The concept of developing a model and its implementation was presented in a computer program SegaeM. A herd is a group of animals which is reflected by the manner of calculations in a model.
The developed model consisting of particular animals in a herd is more difficult to implement for models developed for a herd treated as a whole. However, the herd model consisting of particular functioning elements gives not only results in the form of global indices for the entire herd. An additional feature for such an approach is a possibility of a detailed analysis of the course of use of particular cows. Calculation of indices for particular cows is a concept which simulates calculations similar to the conditions in a real herd. In the recommended model, due to introduction of random events which occur with a specific probability, the effect of uniqueness of each animal was obtained (each cow is unique). Although, the average values (or sums) of the obtained indices are similar to the data obtained from models which treat a herd as a whole, the model generates detailed information on each object. A dynamic manner of calculation of the values of indices in subsequent days (iterations) gives an opportunity to apply a model in the educational game. Except for the scientific value, the model may serve for education within the scope of management of the cattle herd. After a graphical and presentation part was developed, a computer application may serve for teaching students and detailed analysis of processes which take place in the cattle herd [12]. Consequently, getting a deeper insight into these processes can support the optimal decisions taken by farmers and advisory services/agricultural advisors.