Skip to content

fruchtfolge/model

Repository files navigation

Fruchtfolge Model

This repo contains the simulation model used in the Fruchtfolge application.

The mixed-integer linear programming model returns a cropping (and catch crop) recommendation for each given plot.
Overall farm profits are maximised, considering restrictions such as:

  • German Fertilizer Ordinance (2017/2020)
  • Greening directive
  • rotational breaks
  • maximum allowed crop shares in the crop rotation
  • available labour endowments
  • soil quality
  • crop rotational effects
  • effects of field-to-farm distance on costs and labour requirements
  • other user defined constraints

are implemented in the model.

Infeasibilities are avoided by slack variables accompanied with high penalties. In case of an infeasible constraint, users are presented with the closest feasible solution to their problem.

The model is written in GAMS language. You need a valid GAMS license in order to run the model.

Fruchtfolge is a decision support model aimed to be operated by practitioners. If you are a researcher interested in single farm modeling, please have a look at our dynamic mixed integer bio-economic model FarmDyn

Overview

The Fruchtfolge optimisation model comprises of two main parts:

  1. The so called include file, which is generated by the Fruchtfolge application. This file includes all farm specific data, which currently comprises of the individual farms
  • Historical plots
  • Current plots (planning horizon)
  • Plot information, as soil quality, type, distance
  • Historical crops
  • Current crops (planning horizon)
  • Botanical crop groups, linked to the crops (for compliance with the greening directive)
  • maximum crop shares (rotational shares)
  • other constraints defined by the user (e.g. labour constraints, maximum crop shares)

Plot and crop names are obfuscated in order to ensure privacy. Examples of such an include file can be found in the test/include subdirectory.

  1. The main optimisation model logic, which is stored in this repository. The main model logic is farm agnostic, which ensures that the model is capable of solving any possible combination of farm endowments.

fruchtfolge.gms

The main model logic is joined in this file. Here, the objective function is specified and additional constraints are included from the model folder.

model/

Constraints as defined by the Greening directive, or general crop rotational constraints, are stored in the model folder.

Tests

In order to test the model, execute

npm test

The test/include/ folder contains so called include files generated by the Fruchtfolge main application from different test farms. For every farm, a corresponding expected model result with the same file base name needs to be specified in the include/results folder.

Build

In order to build the model, execute

npm run build

Note that only $include statements in the form of $include '%WORKDIR%path/to/file.gms' are correctly concatenated into the final model. Other statements, as $batinclude etc. are currently not supported.