Agricultural System Modelling with Ant Colony Optimization

Cereals contribute significantly to humanity’s livelihood. They are a source of more food energy worldwide than any other group of crops. Their production contributes considerably to the total global anthropogenic greenhouse gas (GHGs) emissions. In this study we propose a basic bio-economic farm model (BEFM) solved with the help of Ant Colony Optimization (ACO) methodology. We aim to assess farm profits and risks considering various types of policy incentives and adverse weather events. The proposed model can be applied to any annual crop.


I. INTRODUCTION
C EREALS are essential for human nutrition and health.
Their production accounts for a substantial amount of the greenhouse gas emission of the agricultural sector, which is in many cases directly affected by a changing climate. The policies of the European Union (EU) recognize these facts. The Farm to Fork Strategy is central to the efforts to decarbonize the economy outlined in the European Green Deal [14]. EU policy encourages agricultural producers to reconcile economic with environmental objectives. Apart from maintaining economic growth, competitiveness, and employment recent policies seek to optimize the use of scarce natural resources such as land and water, to reduce the use of chemical inputs and fertilizers, to promote integrated nutrient management and on-and off-farm biodiversity through sustainable intensification of agricultural systems. The Sixth Report (AR6) of the International Panel for Climate Changes (IPCC) [13], published in August 2021, states that "Each of the last four decades has been successively warmer than any decade that preceded it" (Paragraph A.1.2., page 6 in [13]).
An overview by Reidsma et al. (2018) identifies 202 studies conducted between 2007 and 2015 using bio-economic farm models (BEFMs) [1]. Recent prominent applications include the analysis of cotton production in Uzbekistan [2]. A stochastic dynamic optimization model by Spiegel et al. allows for the representation of managerial flexibility by adopting real options modeling techniques [3]. Another study by Spiegel et al. contributes towards the simultaneous appraisal of investment and managerial behavior and its environmental impacts. The usefulness of the method is demonstrated by an application to a perennial biomass energy production system [4]. A second application to short rotation coppices can be found in the multi-objective optimization model of Rössert et al. [5]. An overview by Britz et al. determines the desirable features of a BEFM by comparing four generic template-based models selected based on preset criteria [6].
This paper proposes a decision-making system based on a BEFM that has the potential to exhibit many desirable features identified by literature. Cropland allocation is framed as a constrained profit maximization problem from the point of view of the farmer. Apart from the resource constraints the farmer is subjected to various policies and environmental influences. The optimization problem thus includes a lot of constraints and some uncertainties. We apply ACO methodology [7] to solve it. The model is calibrated for Bulgarian crop farms.

II. PROBLEM FORMULATION
The problem is framed as a microeconomics profit maximization problem. Farmers presumably maximize their profit every year to by allocating cropland to a specific annual crop and deciding how intensely to cultivate it. They consider various preconditions, such as various prices, price expectations, expenses, costs, taxes, fees, subsidies and, finally, the probability of an adverse events.
The system relying on profit maximization can be applied in the presence of one or more plots and several suitable for sowing crops. The system considers the expected price for each crop, the average yield for each crop for each of the plots. Included are the subsidies for the individual crops that the farmer can receive, as well as the costs for each of the crops related to tillage, planting, fertilization, crop cultivation, harvesting, etc., as well as the costs for each of the plots posed by rent, taxes and fees. Included is the probability of an adverse event reducing yields such as ozone pollution, cold winter, drought, etc. and a coefficient showing the reduction in yield if the event occurs.
The result of the optimization is a recommendation to the farmer with respect to the cropland allocation and the cultivation intensity so that the profit is maximized. Software implementing the decision-making system has been developed. The input parameters are: plots of land; crops for planting; minimum area for sowing crops, on each of the plots; expected price of every crop; subsidy per unit area for every crop; yield per unit area for every crop from every plot; estimated cost per unit area for crop (amount of tillage costs, seeds, fertilizers, chemicals, labor, overheads); costs per plot, independent of the crop sown (land lease, taxes, etc.); likelihood of an adverse event reducing the harvest (ozone pollution, drought, hail, pests, etc.); a coefficient showing the reduction in yield as an adverse event appears.
The decision-making system is calibrated using price and yield data provided by the Bulgarian Chamber of Agriculture. The used crops are the cereals most planted in Bulgaria (corn, sunflower, wheat, barley). The yield data refer to North-East Region in Bulgaria for the year 2018. The prices for crops, subsidies and costs are measured in Euro, while the land is measured in decares.

IV. ANT COLONY OPTIMIZATION ALGORITHM
Nature does not tolerate extravagance. It has millions of years of experience. It can teach us how to achieve maximum results with minimal effort. That is why methods with ideas from nature are so successful.
The ACO is a methodology, which is nature-inspired. It belongs to the group of metaheuristics. The method follows the real ants behavior when looking for food. Real ants use pheromone substance, to mark their path and to return back. Normally an ant moves in random fashion and when it comes across a previously laid pheromone it decides whether to follow it and reinforce it with an additional pheromone. So the more ants follow a given trail, the more attractive that trail becomes. Pheromone evaporates over time. Thus the pheromone level of less/not used paths decreases and they become less desirable later. It prevents the ants from following wrong and useless paths. Observations show that ants manage to find the shortest path between the nest and the food source using only the concentration of the pheromone, i.e. their collective intelligence.

A. Main ACO Algorithm
Problems with strict restrictions and a large number of parameters usually require a lot of computing resources. An option is to be applied some metaheuristics. They are more flexible and fast at the expense of accuracy [7].
For a first time, ant behavior is used for solving optimization problems by Marco Dorigo [8]. Later some modifications are proposed, mainly in pheromone updating rules [7]. The basic in ACO methodology is graph representation of the problem and simulation of ants behavior. The solutions are represented by paths in a graph and the aim is to find shorter path corresponding to given constraints. The requirements of ACO algorithm are as follows: Appropriate representation of the problem by a graph; Appropriate pheromone placement on the nodes or on the arcs of the graph; Suitable problem-dependent heuristic function, which manage the ants to improve solutions; Pheromone updating rules; Transition probability rule, which specifies how to include new nodes in the partial solution; Appropriate algorithm parameters.
The transition probability P i,j , is a product of the heuristic information η i,j and the pheromone trail level τ i,j related to the move from node i to the node j, where i, j = 1, . . . . , n.
where U nused is the set of unused nodes of the graph. The initial pheromone level is the same for all elements of the graph and is set to a positive constant value τ 0 , 0 < τ 0 < 1. After that at the end of the current iteration the ants update the pheromone level [7]. A node become more desirable if it accumulates more pheromone.
The main update rule for the pheromone is: where ρ decreases the value of the pheromone, which mimics evaporation in a nature. ∆τ i,j is a new added pheromone, which is proportional to the quality of the solution. For measurement of the quality of the solution is used the value of the objective function of the ants solution.
The first node of the solution is randomly chosen. With the random start the search process is diversifying and the number of ants may be small according the number of the nodes of the graph and according other population based metaheuristic methods.The heuristic information represents the prior knowledge of the problem, which is used to better manage the algorithm performance. The pheromone is a global history of the ants to find optimal solution. It is a tool for concentration of the search around best so far solutions.

B. ACO for Agricultural Modeling
ACO algorithm is a constructive method. Every ant constructs its solution, taking in to account the constraints. In our application an ant chooses first crop randomly between the crops for sowing and assign it to the randomly chosen possible plot. The assigned land is equal to the minimal lend for this crop. The next crop and plot is chosen applying probabilistic rule called transition probability. If on the chosen land this crop is assigned yet we increase the land with 1. If the number of assigned crops for all lends is less then the minimal number, than unassigned crops have two times higher probability to be assigned, or: where P 0 is a probability for adverse event, Decr i,j is decrease of yield if adverse event appear, d i,j is output for crop i from land j, P i is expected price of crop i, S i is subsidy for crop i, r1 i,j is expenses for crop i from land j, N ij is the sown area of crop i on land j. Thus the adverse event and its influence is taken in to account. When the probability the adverse event to appear is more than 0, then the output of crop i decrease with coefficient Decr. For different crops this coefficient is different, because the adverse event influences different crops in different way. For example the corn and sunflower are more influenced by drought, than wheat and barley.
The used objective function is as follows: Thus the objective function takes in to account probability of adverse event, different expenses, prices of the crops and sown.

V. COMPUTATIONAL RESULTS AND DISCUSSION
Preparing test cases is a complex task. They need be as realistic as possible in order to draw the right conclusions, but also be able to show the qualities and capabilities of the proposed algorithm.
The proposed bio-economic farm model is tested on a test problems with following common parameters: The parameter settings of our ACO algorithm is shown in Table II and are fixed experimentally after several runs.  Several test instances are prepared. The baseline of the bioeconomic model refers to the situation without any subsidy or adverse event. Four scenarios are constructed to showcase the capabilities of the bio-economic model: a subsidy for barley amounting to 11 Euro per decare; with subsidy for both barley 11 Euro per decare and wheat 10 Euro per decare; an 80% probability of drought that decreases corn and sunflower yields with a coefficient of 0.5 for corn and 0.7 for sunflower; a subsidy for barley 30 Euro per decare. When there is no adverse event and subsidy the corn and sunflowers are preferable because they are more profitable than the two other crops, Table III. The situation is not changed when the subsidy of the barley is 11 Euro per decare, Table IV. It means that this subsidy is not effective as an incentive to make the barley attractive to the farmer. We observe that when the barley and wheat are subsided the wheat becomes more attractive than the sunflower for the Land2, Table V. It means that a subsidy of 10 Euro per decare is sufficient to make the wheat more attractive. The drought influences only corn and sunflower yields, thus with a non-zero probability of drought the two other crops become more attractive while the income of the farmer is preserved, Table VI. The last scenario envisions a larger subsidy for barley. We observe that the subsidy is effective as an incentive to make the barley attractive to the farmer, Table VII.
With these five examples we showcase the capabilities of the basic bio-economic farm model. In the baseline scenario, without any subsidy, the crops with the higher profit are more attractive to farmers. We show that subsidies can incentivize the farmers to alter behavior and stimulate the cultivation of crops that are not profitable in the market sense. We show how the potential for adverse weather events such as droughts can  influence profits by affecting yields and that the anticipating farmers adapt to it by changing the crops they sow as to maintain their profit level. The proposed model showcases the influence of selected polices and adverse weather events on cropland allocation and can be adapted for any annual crop. The model can be extended to cover diverse other instruments such as subsidies, taxes, production quotas, guaranteed prices as well as regulations regarding the land management. It can also be extended to describe the production technology of the farmer in detail in particular with respect to the input and output requirements so that it is possible to include environmental considerations in the optimization problem, either as constraints or as desirable outcome of the optimization, e.g. achieving a specific soil carbon balance while maintaining agricultural profits or reducing the use of chemical inputs while maintaining a certain production quota.
This technological detail would also allow us to incorporate emission accounting in the model. This would give us the opportunity to quantify the amount of greenhouse gas (GHG) emissions that are consistent with the production level and the maximum profit. The model we propose can also be coupled to a crop growth simulation model for a more detailed representation of the nutrient balance in the soil or to a hydrological model to model the effects of an adoption of irrigation technology. Extensions are possible with respect to the time horizon of optimization even for annual crops to account for situations such as long-term contracts of the farmer with guaranteed prices. The risk-preferences of the farmer could be considered similar to different management options such as crop rotation. Management flexibility and long-term investment decisions could be incorporated.
VI. CONCLUSION In this paper we propose a decision-making system based on a generic BEFM for annual crops, which has the potential to exhibit many desirable features of a BEFM identified by literature. The model is solved via Ant Colony Optimization methodology. We showcase the possibilities offered by our system by preparing various scenarios. The system can be used to assist farmers with cropland allocation, but also by the state and by the European administration to simulate the effects of technology adoption and for impact evaluation of policies. It will be further developed, thoroughly tested, and compared to existing BEFM to validate the model results, but also to promote the development of an ecosystem of BEFM modelers.