1 Introduction

Farmers, extension agents, and agricultural researchers encounter a growing number of challenges, such as coping with increasing market volatility, producing raw materials to feed the Earth’s projected nine million inhabitants by 2050 and reducing the environmental impacts of agricultural practices (Tilman et al. 2002). To address these challenges, stakeholders and researchers from the agricultural sector work actively to implement more efficient production systems at multiple levels. Using models to help in this screening is a well-recognized practice (Malézieux et al. 2001). However, one key issue for agronomists and environmentalists in this work is to model farmers’ decision-making that roots farmers’ practices (Loyce and Wéry 2006; Bergez et al. 2010). Combining management decision-making and biophysical functioning of the system in a model allows evaluating impacts of farmers’ practices on this changing environment. This is the main aim of the biodecisional models (Keating et al. 2003; Chatelin et al. 2005; Bergez et al. 2006). Modeling crop management decision-making at the field level implies including (i) temporal relations between the technical operations of a crop management sequence, (ii) rules based on crop development and states of the environment that determine when to implement a specific operation, and (iii) optional operations that would be performed due to predictions of the biophysical crop model. The technical operations performed on a crop during a cropping year, i.e., from the harvest of the previous crop to that of the current crop, are organized in an ordered interrelated sequence called a “crop management sequence” (Sebillotte 1974). Each technical operation must be performed during a period defined by the crop development, the state of the environment, and the farmer’s objectives that can be either expected yield or quality or even environmental management (Aubry et al. 1998). Each operation has an optimal starting date, before which it would not help meet objectives, and an optimal finishing date, by which the farmer wants the operation finished. As some constraints, such as adverse climatic conditions, mechanical breakdown, and competition with other tasks that must be completed at the same time, can preclude performing the operation during the optimum period (Papy 2001), farmers also determine less optimal dates to start or finish a task and create a time window for the operation to be achieved.

In 2010, the French cropping system research community developed an integrated modeling platform, RECORD (“REnovation and COORDination of agro-ecosystem modeling”), to gather, link, and provide models and companion tools to answer new agricultural questions (Bergez et al. 2012). One of the requirements in the specifications of this modeling platform is a focus on management: It is particularly important that the platform be able to handle management models for cropping systems. Modeling factors such as technical operation sequences, competition among agricultural tasks, spatial distribution of agricultural practices, and choice of crop rotations in a field must be possible. Despite the fact that the decision formalism is a proposed formalism within RECORD to represent management, it is seldom used by agronomist modelers. The main reason is that it is not friendly enough to draw crop management operations and require too important computing skills. To overtake this difficulty, we developed a computer plug-in that adds specific abilities to describe and specify crop management through a graphical interface as part of the companion tools offered by the platform.

The aim of this paper is to present this newly developed graphical plug-in for decision-making modeling in the RECORD platform and to show how it can describe innovative crop management practices. We first present the conceptual framework used to represent decision-making and then describe the RECORD platform development of the graphical plug-in and its use in an agronomic case study that was focused on developing innovative cropping systems integrating more intercrops, more legumes, and less chemical inputs (Fig. 1). We provide an overview of the graphical user interface plug-in that was developed, explain how it can be used to describe management practices, and present results from the case study. Finally, we discuss the utility of the plug-in and how researchers and developers can use it to improve management practices.

Fig. 1
figure 1

An innovative cropping system developed within the MicMac-Design project. The picture shows a sunflower (Helianthus annuus L.) and soja bean (Glycine max L.) mixture

2 Material and methods

2.1 The RECORD platform

The RECORD platform (Bergez et al. 2012) is a modeling and simulation platform dedicated to the study of agro-ecosystems that was developed by the French research community working on agro-ecosystems. It is based mainly on virtual laboratory environment (VLE), which is a free and open-source software developed in C++ that provides a simulation engine, modeling tools, software libraries, and an integrated development environment (Quesnel et al. 2009). It is a generic modeling, simulation, and analysis environment based on the discrete event system specification (DEVS) formalism that originated from the theory of Modeling and Simulation defined by Zeigler et al. (2000). RECORD allows the design of atomic and coupled models. Different mathematical formalisms commonly used in modeling works, such as difference equations, differential equations, or state charts, are proposed to modelers to build atomic models. RECORD enables the use of different time steps and spatial scales within a model. A graphical user interface was designed to simplify coding tasks, and a dynamic link to the R software was developed to enable statistical work. RECORD has been used in several studies, for example, to model sunflower growth through the use of genotypic parameters (SUNFLO: Casadebaig et al. 2011), crop allocation decision-making at the farm level (CRASH: Dury 2011), or herbage growth (HERBSIM: Duru et al. 2010). RECORD can be downloaded at http://www.inra.fr/record, and tutorials can be found at http://record-elearning.inra.fr/record.

2.2 The theoretical framework of the decision formalism

To represent farmers’ decision-making processes, RECORD uses a specific formalism “Decision.” It allows modelers to represent cropping system complex decisions as discrete event models. During simulations, this extension (i.e., DEVS formalism translated in a VLE code) captures the state of the environment such as weather, plant, soil, or resource availability. It then sends orders to connected models according to a flexible crop management plan, e.g., send to a biophysical model that 30 mm of irrigation is applied to the field.

In recent research papers, cropping and farming systems are represented as three interacting sub-systems (Fig. 2): “Agent,” “Operating,” and “Biophysical” sub-systems (e.g., Le Gal et al. 2009; Dury 2011). A key feature of these systems is that they link crop-soil and decision models, allowing for a better understanding of interactions between the production systems and their management by farmers (Bergez et al. 2010). A knowledge base (KB) contains all information about the system that the farmer can use to reach a decision: dynamics of the state variables, state of the resources, and also spatial information about farm structure using geographic information system (GIS) (Dury 2011). Observations received by the decision model update the KB using functions called “facts.”

Fig. 2
figure 2

Diagram of a general biodecisional simulation model. The conceptual model is based on the division of an agricultural system into three sub-systems: Agent, Operating, and Biophysical (Le Gal et al. 2009; Martin-Clouaire and Rellier 2009). The three sub-systems fill a knowledge base (KB) that is used by the Agent system to make decisions. The farmer’s plan is represented by the operation sequence as a dynamic task network

The Agent sub-system represents an activity plan that is the different technical operations to be performed and consists of a graph of tasks and relations between tasks. Formally, the activity plan is a direct multi-graph without loop (G = (V, E)), where V represents the tasks and E the links or relations between the tasks. The tasks are defined as tuples:

  • Preconditions represent the requirements for executing task V. Preconditions are a set of predicate functions, each of which queries the KB. An example can be: “Did it rain in the last three days?” This function returns TRUE or FALSE. If all predicates are TRUE, then the preconditions are valid.

  • Status describes the current phase of the task as one of the following: {WAITED, STARTED, ENDED, FINISHED, or FAILED}.

  • Time windows represent the earliest and latest starting and ending dates.

Links represent relations between two tasks. A link can be valid or invalid according to the status of the source and target tasks. Like tasks, links are defined as tuples:

  • Types represent the relation between tasks i and j. A type can be one of the following: {S i S j , F i S j , F i F j }, indicating whether one task must start (S) or finish (F) before the other.

  • Time lag window defines the time lag in the relation between tasks, for example, ensuring that task j can start after two units of time after the end of task i.

The behavior of the task network is based on the TRUE or FALSE status of Preconditions, Time windows, Types, and Time lag window. When a task changes Status, the modeler can attach a function update that may change multi-graph G by adding or removing tasks or links. An activity can be triggered either at an “optimal,” “degraded,” or “forced” moment, which represents the gradual relaxation of constraints as time passes and the completion deadline approaches.

A crop management decision model is then defined by (i) a set of variable members of KB and associated facts (update functions); (ii) tasks and associated predicates, rules, and time windows; and (iii) temporal relations between tasks.

2.3 Case study: the MicMac-Design project

The MicMac-Design project (http://www.inra.fr/micmac-design) aims to design and evaluate innovative cropping systems to increase productivity of agro-ecosystems while preserving the diverse ecosystem services they provide or support. The project uses both field experiments and simulations. One of its methodological originalities concerns the effort made to formalize management practices using decision rules. Therefore, MicMac-Design is a suitable case study in which to test the newly developed decision plug-in to formalize and implement a decision model that represents the complex management decisions made during a cropping cycle. Table 1 presents an example of a crop management sequence tested in the project. Some of the originalities of this cropping system prototype are that it uses mechanical weeding to reduce the use of herbicides and it introduces sorghum instead of maize to decrease the use of irrigation water.

Table 1 Description of the observed technical operations for the 3-year rotation cropping systems “sorghum-sunflower-durum wheat”

3 Results and discussion

3.1 The graphical user interface of model decision-making

This theoretical framework has been designed as a software plug-in that adds specific features to VLE, the existing software simulation tool. This plug-in is provided as a software package “vle.extension.decision.” Its architecture has two levels: the C++ class implementing the formalism itself and the graphical interface that helps modelers in building and parameterizing the decision model.

The decision model plug-in’s main window is divided into four sections (Fig. 3a). The menu bar at the top (1) is used to manage files, i.e., opening, saving, and editing activity plans. The center drawing panel (2) is used to draw the plan, i.e., the succession of activities that describe the technical operation. The right-hand panel (3) allows selection or deletion of items in the drawing panel as well as addition of new activities or constraints. The bottom panel (4) is used to access specific editors that will help describe facts, predicates, and rules. A plan of activities can be created in a six-step approach:

  1. 1.

    Create the facts in the KB using the “KB” button on the bottom panel. Facts can be weather data such as temperature, rainfall, evapotranspiration, or crop status, e.g., leaf area index, nitrogen content, water stress index, or soil status, for example, mineral N concentration and water holding.

  2. 2.

    Add an activity using the “Add activity” button on the drawing panel.

  3. 3.

    Create predicates used by the activity using the “Predicates” button on the bottom panel. Example of predicates can be “Has it rained more than 10 mm for the last three days?” or “Is the crop already sow?”

  4. 4.

    Create rules for changing the status of the activity using the “Rules” button on the bottom panel. The user will have to choose the predicates that will be used by the rule (Fig. 3b).

  5. 5.

    Link the activity to the rules by editing the activity properties (right-clicking on the activity) (Fig. 3c). The user may also add temporal constraints for the activity filling the “Activity Min Start” and “Activity Max Finish” fields in the “Activity” window.

  6. 6.

    Repeat steps 1–5 for the other activities and link them by adding constraints using the “Add constraint” button on the right-hand panel. These constraints describe relations between the tasks.

Fig. 3
figure 3

Graphical user interfaces of the decision plug-in. a The decision model plug-in’s main window is divided into four sections: (1) the menu bar at the top to manage files, (2) the center drawing panel to draw the plan, (3) the right-hand panel to select or delete items, (4) the bottom panel to access specific editors; b the “Rules” window allows to link predicates to rules; c the “Activity” window allows to link the activity to the rules

To trigger one task, several rules can be created. Once one is TRUE, the task is performed. Once an activity plan is created, it can be saved and reloaded for further use or modification. Since activity plans are independent of biophysical models, they can be used with any biophysical model, provided that their facts (the KB) and variables match those of the biophysical model. In addition, several activity plans can be created in one agent model.

Compared to other generic frameworks such as APSIM (manager and operation components, Keating et al. (2003)) or APES (agro-management component, Donatelli et al. (2010)), our plug-in has the same description of crop operations, which can be activated by factors such as the state of the crop or the soil. In contrast, our plug-in allows temporal constraints between activities to be defined, which represents the fact that all operations of a crop management sequence are linked and must follow a specific order and that some have to be finished before others start. These temporal relations are modeled with the graph formalism.

3.2 Application to the MicMac-Design project

Each cropping system designed in the MicMac-Design project was formalized using the decision paradigm described. The overall activity plan was split into sub-plans (one plan per crop) to facilitate their potential reuse. The number of activity plans developed for a crop rotation was thus equal to the number of crops and intercrops in the rotation. As an example, within the 3-year rotation for durum wheat/sorghum/sunflower (Table 1), three activity plans were created to simulate each component of the rotation. The activity plan determined for each individual crop could thus be reused in another context. The three activity plans were used successively by the decision-making model during simulations of the 3-year rotation. In the following, we will focus on the sorghum crop.

Based on the agronomic description of a crop management sequence (Table 1), activity plans were created using the decision plug-in. Figure 4a provides an example for sorghum (Sorghum bicolor) that is the second year of the 3-year rotation from Table 1. The activity plan contains an exhaustive list of technical operations for the given crop. Each activity is defined by (i) a time window in which the activity can be performed, (ii) a set of activation rules, and eventually (iii) outputs such as nitrogen quantity applied to the crop for a fertilization activity or seed density for a sowing activity. Time constraints between activities are also expressed. In order to be sure that a task is performed even if all preconditions are FALSE, we added the possibility to use a systematic “forced rule” that triggers the activity at a given date. This leads to the specification of three rules in the decision model for each activity. For example, three rules exist for sowing a sorghum crop: SowingOptimal, SowingAcceptable, and SowingDeadline (Fig. 4b).

Fig. 4
figure 4

a Activity plan of the sorghum operation sequence created with the decision plug-in. The different technical operations (Tillage, False Seed Bed, Sowing ….) are created with temporal constraints (FS). b The rules and the associated predicates for the activity plan of the sorghum operation sequence. A single operation “Sowing” may be performed either under optimal conditions (“SowingOptimal”) or acceptable conditions (“SowingAcceptable”) or forced (“SowingDeadline”). c After simulation using the STICS crop model as the biophysical model, the resulting sequence of technical operations is performed during a season and the leaf area index dynamic. The vertical dashed lines show the experimental technical operations while the vertical solid lines show the simulated ones

The decision model created was linked to the crop model STICS (Brisson et al. 1998) to simulate soil/plant functioning. The decision model sends “events” (i.e., indicators) that trigger management activities such as sowing, plowing, irrigation, fertilization, and harvesting. In return, STICS sends facts to the KB that are used to test predicates. The list of facts sent to the decision model is given in Table 2. In simulations, technical operations are performed in the sequence necessary for crops to grow correctly (Fig. 4c). This figure shows the simulated and the experimental agricultural management practices for the sorghum crop as described in Table 1. One can see that there are some slight differences between actual and simulated dates.

Table 2 List of facts sent to the decision model

The created plans can be tested for different soil and climate conditions, reused for different crop rotations in the same model, or even in other crop models under RECORD. To perform this modeling task, close cooperation between agronomists and modelers was necessary. This modeling work simplifies the testing of practices that go beyond standard agronomical setups, for example, by creating virtual experimental designs with different threshold values for triggering certain actions. It is also possible to consider local constraints more precisely for the processes simulated. For example, decisions can be made according to the state of the overall context and not according to a value specified at the beginning of the simulation. It is thus possible to simulate both (i) farmers’ plans at the beginning of the cropping year, when they choose crop management sequences according to a given yield objective, level of fertilization, pest management strategy, etc. and (ii) farmers’ daily adaptations, when they must change their plans based on the state of the agro-ecosystem.

As previously explained, several models exist that are dedicated to either one crop (e.g., DECIBLE for wheat (Chatelin et al. 2005)), one management practice (e.g., MODERATO for irrigation (Bergez et al. 2001)), or a combination of both (e.g., SACADEAU for herbicide spraying on maize (Gascuel-Odoux et al. 2009). Our plug-in is much more generic because it can work with any kind of crop or management practice. Even though it has been used mainly for annual crops, it is well suited for simulating other kinds of crops, such as vegetables or orchards. It could also be used to simulate grassland management practices, such as sowing or making hay or animal grazing. Its design allows creation of basic plans (including activities, rules, predicates, and temporal constraints between activities) without knowledge of C++ or more complex plans with some knowledge of C++.

3.3 One step further

The graphical plug-in is an initial improvement and companion tool of the RECORD platform. Development of two other tools is planned to improve the platform’s representation of decision-making:

  1. 1.

    Linkage to a GIS to manage input data needed to simulate crop management practices, since farmers’ crop management decisions are based on environmental characteristics, mainly of soils and climate, which are spatially organized. Furthermore, it is nowadays easy to obtain farm field patterns in the European Union (EU) via declarations for EU Common Agricultural Policy and the Land Parcel Identification System. The data are spatially explicit, readable by any GIS software, and could be used to initialize models.

  2. 2.

    Creation of tools to help evaluate and choose among simulation results, e.g., graphical representation of simulated activity plans, optimization, and multi-criteria analysis.

At the farm level, farmers have limited labor and machinery resources. Depending on the amounts and characteristics of these resources, farmers may not be able to simultaneously follow the crop management plan designed for each crop. Instead, farmers must choose which practices to perform first (Papy et al. 1988) based on (i) the total amount of work they and other farm workers can accomplish at the same time, (ii) the state of farm crops, (iii) the rate at which each practice is performed, (iv) the deadline for performing each practice, and (v) workers’ ability to perform each practice. Moreover, the spatial organization and shape of fields also influence the order in which practices of each crop management plan are performed. Therefore, adding resource management to the plug-in is the next challenge (Martin-Clouaire and Rellier 2009).

Finally, a future step could be the creation of a library of practices to test conservation agriculture, agro-ecological practices, or organic farming. In this way, and using simulation, one will be able to analyze the impact on such practices depending on soil and climate conditions and to provide useful insights for a better transition to a more agro-ecological agriculture.

4 Conclusion

Using simulation modeling to test complex agricultural practices is an appealing method; however, attempting to simulate a chain of agricultural operations can become tedious. The graphical plug-in developed simplifies this work and graphically represents relations between tasks. Furthermore, the chain of agricultural operations created is independent of biophysical models.