HomeQuick GuideThe ManualDocumentationRegionsTeamContactData Protection

  1. Quick Intro
    1. General info

      The Agricultural Policy Simulator (AgriPoliS) is an agent-based model that can be used observe and analyse the effects of policies and shocks on farm structural change over time. The agents are heterogeneous typical farms of a region. The agents? goal is to maximise their profits if they are a corporate farm, and their household income if they are a family farm. They exercise these decision with regard to their production, investments, factor use, and land rental. The environment are the farms, markets, and space. The agents interact via markets.

    2. Land market

      At the beginning of each iteration, agents are given the opportunity to rental bids on newly available plots of land. The agents decide how much to bid on each plot based on the additional plot's expected returns. The highest bidder receives the plot.

    3. Investment

      Each agent then assesses whether they could expect to increase their profits by investing in new machinery or stables. If they expect a new investment to increase their profits, they invest.

    4. Product

      Each agent decides what to produce given their land, machinery, stables, and labour in order to maximise their profits or household income.

    5. Exit?

      Finally, at the end of each iteration, the agents either continue on farming for another year or exit agriculture. If an agent can expect to earn more off-farm and through renting out their owned land, the farm closes. If the agent expects to earn more from farming, they continue for another iteration.

  2. Concepts

    For the Overview and Design concepts Sahrbacher et al. 2012 is used. That paper describes AgriPoliS following the ODD protocol (Overview, Design concepts and Details) described in GRIMM et al. (2006) and GRIMM et al. (2010).

    1. Overview

      Purpose: The main purpose of the model is to understand how farm structures change within a region, particularly in response to different policies. Structural change in agriculture is the result of farms' individual decisions. Each farm decides what to produce and how much, whether it is worth renting additional land or rather releasing some of it, or even to exit agriculture if necessary. Depending on their individual situation and their neighbourhood, farms react differently to the same environmental conditions or policy changes. The heterogeneity in the farm population allows covering these individual responses. Land markets play a crucial role in agricultural structural change. Because the dynamics on land markets are mainly determined by the interactions between individual farms, an agent-based approach offers many advantages for creating an explicit land market.

      Entities, state variables and scales: The model comprises different hierarchical levels: farms, farm population, plots, landscape, markets and political environment. The model?s main entities are farms, production activities, investment objects, plots, markets and the political and economic environment. Plots are individual equally-sized cells in the artificial region. All plots joined together constitute the artificial region, like fields constitute specific landscapes in the reality.

      Farms are income or profit maximising entities and characterised by state variables such as an IDnumber, age, managerial ability, location in space and the amount of production factors (land, capital, labour) they own, or rent. A farmer actively manages a farm during 25 years (maximum duration of management) and hands his farm over to a possible successor after this period, i.e. AgriPoliS considers generation change. Age corresponds to the number of years a farmer is already managing his farm. Whereas managerial ability, location and the amount of family labour stays constant over time, the amount of land and capital can change. Capital is further separated into liquid assets, fixed assets (Investment objects) and entitlements for production (milk quota). Farms can choose out of a list of production activities and investment options in order to make an optimally use of their production factors during the production process.

      Regarding production activities, it can be further differentiated between plant production activities, livestock production activities and auxiliary activities. All production activities are continuous decision variables and characterised by an ID-number, a revenue, production costs and a price flexibility. Production activities are associated to a production branch like in EU's Farm Accountancy Data Network (e.g. field crop, milk, grazing livestock and pig and poultry). This allows the classification of farms according to their production branch. Furthermore, production activities are associated to a type of investment which is necessary for the production. Labour requirement and the premium associated constitute state variables common to plant and livestock production activities. In addition to this, plant production activities require land of specific soil type and machinery as well as restrictions for crop rotation. Some plant activities can supply fodder for livestock. Livestock production activities require stable places and fodder. Furthermore, they are characterised by a livestock unit. Auxiliary activities are defined to allow an optimal use of capital and labour. Thereby, either overcapacities of production factors can be reduced (e.g. saving money, working off-farm, leasing quota) or scarce capacities can be borrowed, hired or leased in a short term perspective (money, labour, quota, machinery). Only revenues and premium can change over time due to changes in the political and economic environment. Production costs vary among farms according to their managerial ability.

      All investment objects are integer variables, i.e., they are not dividable and they are financed with a specific share of long-term borrowed capital. The interest rate of long-term borrowed capital is the same one for all investment objects. Further state variables of investment objects are: an ID-number, type of investment (hog house, cowshed, machinery, hiring a worker for a year or working off-farm for a year), production capacity, investment costs, maximum useful life, age, maintenance costs, labour saving due to size effects and technical progress associated with the investment. Technical progress depends on investment size.

      Plots are basic elements of the grid representing an artificial landscape. The state variables of these basic land units are size, location, soil type, ownership, rental price, rental contract duration and age of the contract. Location, size and soil type of a plot are constant during the simulations whereas the ownership status, the rental price and the age of the contract can change over time. The soil type defines land of a specific quality (e.g. high, medium, low, etc.). Depending on the quality, land can only be used for specific production activities and generate a particular yield. Thereby, it is indirectly differentiated between arable land, grassland and non-agricultural land (settlements, roads, rivers, lakes and forests that cannot be used for agriculture). Plots are also characterised by their ownership status; they can be owned, rented or abandoned. Rental prices can change because an endogenous rental market is modelled. Rental contracts have a fixed duration and are terminated when the age of the contract equals the duration. The contract duration is randomly drawn from a uniform distribution whereby a minimum and maximum contract duration is set. Taken altogether, the location of the plots, their size and the soil type form an artificial landscape.

      The landscape is represented by five different layers: ownership, soil distribution, block, allocation and usage/field layers. The ownership layer defines the ownership of a specific plot. The second layer represents the distribution of different soil types across the landscape. The block layer replicates the distribution of contiguous areas of given soil types (e.g. arable land and grassland) thus reflecting the geophysical conditions in a region. Such a block is defined as a group of contiguous plots of the same soil type that is separated from other plots of the same type either by another soil type. Two plots are contiguous if they are adjacent to each other. The allocation layer represents how blocks are allocated to farms. Contiguous plots belonging to a farm are called sub-blocks. Plots in a sub-block can either be rented or owned by farms. The fifth layer reflects farms? land use, i.e. a field comprising contiguous plots used by a particular farm for a particular purpose (e.g. wheat production).

      Markets are distinguished according to their scale and the applied rules. Regarding the scale, markets are either national and EU-wide, regional or regional and spatially organized at the same time. National and EU-wide markets both follow the same rules which are applied to products like crops, oil seeds, sugar, capital, labour and services. Products traded on regional markets differ from region to region and depend on the specific characteristic of the region modelled. Therefore, even the market rules can differ among products. As the study regions are predominantly small, the effect on prices of nationally and internationally traded products should be marginal. Thus, the national and EU-wide markets are in almost all cases not used. At the regional scale, these are, e.g. a market for manure (Germany, France), a market for calves (Sweden, Västerbotten and Jököping), or a market for milk quota (almost all regions). For regional spatially-organized markets it is assumed that goods are not traded on spot markets. This applies to the land market which is organised as an auction.

      The political and economic environment mainly affects prices and payments for production activities over time. Price changes may be caused by changes in the agricultural policy or in the economy. In addition, there might be new obligations to be fulfilled so that farmers receive payments.

      In general only a proportion of a region is simulated because of computational time constraints. The plot size is chosen based on regional and computational criteria and varies between 0.5 and 5 ha. For computational reasons the plot sizes should be as large as possible because the number of plots depending on the plot size and the region size is a crucial figure. The more plots there are, the more time is necessary for the allocation of free plots and therefore the longer a simulation will last. A simulation normally runs over 25 time steps (periods) where each time step is equivalent to one year.

      Process overview and scheduling: In each period the farms go through the following processes in the presented order: land auction, investment, production, update product markets, farm accounting, set policy, disinvest, exit decision, period results. The schedule is the same for each period. Each process begins when all farms are finished with the previous one. Farms? order stays the same in each single process. For land auction, investment, production and exit decision farms apply a Mixed Integer Programming model (MIP model, cf. Hazell and Norton 1986) order to make their decisions in each step. The MIP model brings together farm?s endowment of production factors, the production activities and the investment options.

      In the first period all plots are distributed to farmers, thus land auction is not necessary. In the following periods free land is allocated among farmers via a sequential first-price auction. In each sequence, bids are made for only one plot. I.e., every farm selects the plot which is most valuable to it and then calculates the bid accordingly. The farm with the highest bid gets the plot it wishes. The auction is repeated afterwards until all plots are allocated or until there are no further positive bids. The fact that farms bid for the most valuable plot instead of all farms bidding at the same time for one plot avoids first-mover advantage. To consider complementarities between different soil types, the auction alternates between them. When a plot is rented a contract duration is assigned to it. The contract duration is binding, that is neither the land owner nor the land manager can terminate or renegotiate the rental contract during the entire contractual period. Based on their actual amount of land, farms calculate one after another whether they want to invest or not. After investment decisions are made, the available hours of labour, liquidity as well as stable places and machinery endowments are updated. In the production process each farm chooses the amount and combination of production activities in order to optimally use its production factors. The total amount of products is summed up and transferred to the market, where product prices are updated accordingly. The actual prices are then considered in farms' accountancies. For the farm accounting financial indicators such as income, profit, equity capital change, depreciation of buildings, withdrawals for unpaid family labour etc. are calculated. Unpaid family members withdraw a certain amount of money from the farm's profit for paying taxes and consumption. Remaining money is saved and increases equity capital. If withdrawals are higher than profit, equity capital is reduced. Accountancy data for each individual farm are written in output files and apart from this, data is aggregated for all farms as well. At the end of each period, farms receive information about the political and economic environment for the next year. This affects the farms' expectations for the future. In the disinvest process, the amount of production factors is updated, that is plots with terminated rental contracts are released and investment objects at the end of their useful lifetime are subtracted from the list of farm's production factors. Considering the updated production factors and their expectations regarding future policy and economic environment, farms decide whether to continue farming or not based on the objective to maximise profit or income. Therefore, they calculate their expected income from agriculture for the next year and compare it with the opportunity costs of their production factors. If the age of a farmer is equal to the maximum duration of management a generation change takes place. Therewith, opportunity costs of a possible successor are assumed to be 25% higher because education and training are considered as specific and irreversible investments. If opportunity costs are higher than the expected agricultural income, farms exit the sector. They also do so if they are illiquid. Land released by terminated contracts and exiting farms is available for renting in the next period. The simulation terminates when the number of specified time steps is reached or if all farms stopped farming.

    2. Design concepts

      Basic Principles: The following economic concepts are considered in the model: profit or income maximisation, sunk costs, path dependency, economies of size, myopic behaviour, shadow price, transport costs, and opportunity costs.

      According to the theory of sunk costs farms do not consider costs of assets (stables and machinery) because these costs arise anyway. This is a realistic assumption because a market for agricultural buildings does not really exist. Sunk costs affect farmers' behaviour and lead to path dependency as shown by Balmann et al. (1996). Path dependency describes a situation where a system is locked in and can only be abandoned at extremely high costs (Arthur 1989). Economies of size are implemented in the model so that investment costs per unit decrease with the size of the investment. Moreover, labour is assumed to be used more effectively with increasing size.

      Farm decision making is myopic or boundedly rational (SIMON 1955, 1956, 1996), that is, agents make decisions based on the information available to them, which can possibly even be wrong. The decision problem of the modelled farms is highly simplified compared to that of real farmers in that strategic aspects are not included. Indeed, individual farms in AgriPoliS have information on rents as well as product and input prices but they do not know about other farms' production decisions, factor endowments, size, etc. Farm agents are also boundedly rational with respect to expectations. In reality in a majority of cases, farm agents follow adaptive expectations. Merely policy changes are anticipated one period in advance and included into the decision making process.

      To rent land, farms formulate a bid about how much they are willing to pay for renting an additional plot. This bid is based on the farm's shadow price of land. The shadow price is the value by which the farm income would increase if the amount of scarce production factors, here land is increased by one unit (cf. Hazell and Norton 1986).

      Compared to regional models like RAUMIS and farm group models like FARMIS, AROPAj and FAMOS (HENRICHSMEYER et al. (1996), JACOBS (1998), JAYET et al. (2007) and HOFREITHER et al. (2005) ) which are mainly used to predict agricultural production, AgriPoliS considers space explicitly. Even if, the landscape in AgriPoliS is rather a model of the real landscape than an exact replication of it (e.g. GIS-based) this allows considering transport costs from the farmstead to the plots and thereby spatial competition on the local land market.

      Emergence: Structural change and land price evolution emerge based on the individual decisions of all farms. How a farm develops can only be predicted to a certain extend based on the initialization (e.g. product prices and costs). A farm's development always depends on decisions of neighbouring farms.

      Adaption: Farms adapt to changing conditions on markets, their local environment and to policy changes by changing the combination of their production activities or production factors in particular by investing in new objects. Furthermore, they can grow by renting additional plots or shrink. Shrinking is not an active process. Farms release land only when a rental contract for a plot is terminated or if the farm is closed down. Surviving farms can try to lease the plot again or other plots by formulating a bid but it is not sure that this will be the highest bid and that they get the acceptance. A final and irreversible adaption is the exit from agriculture.

      Objectives: Farms maximise their household income by using mathematical programming. Therefore, a one-period Mixed Integer Programming model is built including continuous production activities (hire employees on an hourly basis, grow crops on a certain proportion of farmland, borrow credits, etc.), integer investment options (build one stable and not parts of it, hire an employee on a yearly basis and not parts of them), farm's production factors and general production restrictions (cf. Hazell and Norton 1986).

      Prediction: Farms expectations about future prices are adaptive.

      Sensing: Farms are assumed to know their own state and the state of their investment objects and plots. They also get information about policy changes and price changes caused by policy changes one period in advance. Furthermore, farms sense the state of all plots in the region, and hence can determine which additional plot they wish to rent. However, they do not have any information about their neighbours.

      Interaction: In AgriPoliS, farms interact indirectly via the land market as well as via markets for products. On the land market, farms are directly competing with each other. Product markets can be influenced by the individual farmer's production decision as the supply of a product affecting its price. National and EU-wide product markets are coordinated via a simple price function with an exogenously given price elasticity. For regional markets other rules exist.

      Observation: AgriPoliS produces results at the sector level as well as for each individual farm at each time step. It delivers results related to economic indicators, production, and investment. Depending on the research question different indicators are analysed. Economic indicators such as profit per farm, economic land rent, rental prices or farm growth are systematically analysed. Results on production and investments are analysed to understand the economic effects.

  3. Modules

    For the description of the modules Pitson (2021) is used, which largely based on the AgriPoliS input and output objects description found in section 3.4 of Happe (2004).

    For the farm agents to make decisions, they must have a set of rules to follow. Generally speaking, the agents must maximise their profits or incomes. Given the complexity of each agent's decisions, a more detailed account of the decision-making is necessary to avoid the model being a "black box" of calculations. This section details the processes and calculations that the agents make to decide how they can maximise their situation, given the constraints they face.

    Before delving into the details of the model, it is essential to have an overview of the steps the agents go through in each simulation period, representing one year. Figure 1 is a flow chart that describes these steps in the core version of AgriPoliS. First, the model region is initialised, where the variables such as managerial ability, investments and their ages, farmstead and plot locations, age of farm are randomly assigned. The distribution of the variables can be adjusted to reflect the characteristics of the simulated region or scenario. Then, each agent begins its decision-making process. First, the agent calculates its bids for available land plots based on its expected returns from cultivating that additional plot. The bids go out to the land rental market, the main point of agent interaction and the highest bidder receives the plot. Next, the agent assesses the state of its investments and decides whether investing in this period would maximise its profits or income. After, based on the agents' resources, the agent decides what to produce. Then, it does its annual accounting, which leads it to decide whether it will continue to farm. Agents that are illiquid or whose operator could earn more off-farm exit agriculture. Agents who are at the age of retirement and have a successor that could earn more off-farm exit agriculture. If the successor cannot earn more off-farm, the successor takes over, and the farm continues. In all cases of farm closures, the land returns to the land bank, where the remaining farms can bid on it.

    Figure 1 Agent decision-making flow chart

    Table 1, describes the variables used in the calculations throughout the simulations.

    Table 1 AgriPoliS variable names
    1. Planning

      Agents make plans to maximise their annual household income or profits based on their expected prices and costs, given their resources and constraints.

      For agents to find their optimal use of their resources, a mixed-integer program (MIP) is used. A MIP is used because investments and fixed labour are non-divisible, thus integer activities. A MIP solves for the optimal actions given the restrictions. In AgriPoliS terms, the MIP maximises the agents' household income/profits by telling the agents what to produce given their:

      factor endowments (land, machinery, stables, labour, liquidity),
      market situation (prices, costs, labour demands, premiums),
      production requirements and constraints, and
      economic conditions (off-farm work opportunities, interest rates, access to credit).

      Using the abbreviations in Table 1 the MIP optimisation problem is expressed as:

      $$\text{max }\quad Y^e(\boldsymbol{x}, \boldsymbol{p^e}, \boldsymbol{c}, \boldsymbol{A}, \boldsymbol{I}, \boldsymbol{r}, MP, D, RE, L, BC, IC ...)$$ $$ Y^e= \boldsymbol{x^\prime} (\boldsymbol{p^e}-\boldsymbol{c})+IR+S+W-RE-MC-D-OV-TC-IC-HW $$ $$ \text{ subject to }\quad \boldsymbol{b} \ge \boldsymbol{x^\prime r} \quad \text{with} \quad \boldsymbol{r}=(r_1,...,r_l;..., r_H,...,r_J ) \quad \text{ and} \quad \boldsymbol{x}\ge \boldsymbol{0} $$
    2. Land

      The land market plays a central role in AgriPoliS as it is the primary interaction between agents. Each plot in the model is the same size, and plots are not divisible. Model plot sizes represent the average plot size of the region. Farm agents can own land if it is common in the real region. The amount and types of owned land are assigned to agents at initialisation. Agents may not sell their land but can choose to rent it out to maximise their profits or household income. Equally, agents cannot purchase land. Instead, they compete in the land rental market.

      Agents bid annually on available plots in an iterative auction. In making their bids, agents take into account transport costs, potential economies of size for their machinery, taxes, and administrative costs. The bid BIDy,z for plot Py,z of either land type is a function of both transport costs TCy,z between the farmstead and the plot, and the number of adjacent plots T defined as:

      $$ BID_{y,z} = (q_{land} - TC_{y,z})\cdot \beta + T \quad \text{when}\quad 2\lt T\le 8 $$ $$ BID_{y,z}=(q_{land}-TC_{y,z}\cdot\beta \quad\text{when}\quad 0\le T \le 2 $$ $$ \text{with}\quad 0\lt \beta \lt 1 $$

      $q_{land}$ is the agent's shadow price, or estimate benefit, of an additional plot. The shadow price is determined by the MIP, which produces the vector q, shadow prices of scarce resources. The parameter ? reduces the bid to reflect the costs associated with leasing land, e.g. taxes, administrative costs, labour costs and fees, and the additional rent derived from renting that specific plot. The agent with the highest bid receives the plot.

      The length of the rental contract is randomly assigned based on typical rental contracts in the region. In AgriPoliS, there are no penalties for farms that terminate their rental contract early. Land enters the rental market by contracts ending or farms closing and their owned land being put up for rent. An agent terminates their contract for a rented plot early if the shadow price does not cover the plot's costs, consisting of the rent and transportation costs.

    3. Expectations

      The agents plan their production based on their expectations, as the actual prices and costs are revealed at the end of the model year. These expectations are short-term, including the next period or model year. The agent assumes that in the periods following, the prices and costs will remain constant.

      Agents determine their price expectations for production activity i in period $t +1$ by:

      $$ p^e_{i,t+1} = ({p_{i,t}}^\alpha\cdot {p^e_{i,t}}^{(1-\alpha)})\cdot \gamma_i^{-1} \quad \text{ with}\quad 0 \le \alpha\le 1\quad\text{and }\quad p \gt 0 \quad\text{for}\quad i = 1,K,I$$

      Coefficient $\gamma$ accounts for the price trend, the percent change in price from the previous period, in production activity $i$ , where prices increase if $\gamma\lt 1$ and decrease if $\gamma\gt 1$ . The actual and expected prices in period $t$ are equally weighted, $\alpha=0.5$ .

      Agents form cost expectations for agricultural activities similar to that of prices, minus the price trend. They are calculated as:

      $$ c^e_{i,t+1}= {c_{i,t}}^\alpha\cdot {c^e_{i,t}}^{(1-\alpha)} \quad\text{ with}\quad 0 \le\alpha\le 1 \quad\text{for}\quad i = 1,K, I $$
    4. Investments

      The investment options in AgriPoliS comprise of typical machinery and stables that would be used in the region. Each agent has its investments based on the type of farm it is. At initialisation, each agent's investments are randomly assigned an age. Each investment has a cost, production capacity (animals or hectares), lifespan (model years), labour requirements (hours), and maintenance costs. An agent invests if it expects that the investment(s) would return higher profits or household income than its current situation. Based on their price and cost expectations, agents calculate what they expect their income or profits to be if they were to invest.

      In AgriPoliS, economies of scale are assumed and realised through investments. Larger investments have a lower cost per unit produced compared to smaller investments. The larger the investment, the smaller the labour demands per unit, resulting in lower costs per unit produced. Investments are sunk costs, which cannot be sold once purchased.

      When considering a new investment, agents account for the cost-savings of using more advanced technology. For livestock, they formulate their cost expectations $c^e_{i,t+1}$ of production activity i produced with investment object I as:

      $$ c^e_{i,t +1} = c_{i,t} - f_{o,i}\cdot c_{i,t } \quad\text{with}\quad 0 \le l \lt 1 \quad\text{for}\quad i = 1,K, I $$

      Where factor $f$ represents the size of the investment, with the factor increasing with larger investments.

      For plant production, larger machinery's cost savings can only be realised if the agent has sufficient land. An agent with 100 ha will not save on machinery costs per unit if they invest in a large tractor suitable for farms 500 ha and larger. An agent with 500 ha is better off to buy a larger machine than several smaller machines. Expected costs of plant production activities $c^e_{i,t+1}$ are a function of costs at the outset of the simulation in period t=0, adjusted by a factor l, a function of the average number of adjacent plots and the size of the farm calculated as:

      $$c^e_{i,t+1 }= c_{i,0} - l \cdot c_{i,0} \quad\text{with}\quad 0 \le l \lt 1\quad\text{for}\quad i = 1,K, I $$

      Factor $l$ captures the effect of land size and is calculated as:

      $$ l_t=\left[ 1-\frac{0.15}{(1+100/Z)}\right] \cdot \left[ 1-\frac{0.45}{1+100/(10\cdot AP_t+1)}\right] $$

      Investment-related expenditures are distributed throughout the investment's lifespan. The average annual costs, $AC_h$ , of investment, $I_{h,i}$ , considered in the farm-planning objective function are calculated by:

      Agents use long-term loans to finance their investments. The loan runs for the investment's lifespan, and each agent receives the same rate of interest on a long-term loan. An agent will only invest if its share of self-financed capital does not exceed its minimum capital reserve (MR), calculated using the defined variables in Table 2 by:

      $$\sum^L_{l=1} (v\cdot A_l) \le L + 0.7\cdot LA + 0.3 \cdot \sum^L_{l=1}A_{ec,l} \quad \text{with}\quad L=EC_{t-1}-LA-\sum^L_{l=1}A_{ec,l} $$

      This means that 70% of land assets (LA) and 30% of the financed fixed assets must be covered by the agent's capital $EC_{t-1}$ at all times. The parameters 0.3 and 0.7 were set because they produced the most realistic results during calibration tests (Happe, 2004).

    5. Annual Accountancy

      After an agent has made all of its decisions, the model year ends with the annual accounting. At this point, each agent decides whether or not to continue. In the core version of AgriPoliS, a farm closes for three reasons. A farm closes if it is illiquid, meaning it could not get a line credit. The second reason a farm closes is if the agent's opportunity costs are too high or if the agent could earn more off-farm. The third reason that a farm closes is if it is time for retirement and the agent's successor's opportunity costs are too high. It is assumed that as agents age, they will earn less off-farm than the successor. Table 2 describes selected variables calculated in the year-end financial statements.

      Table 2 Annual calculations of selected variables
      Source: adapted from Happe (2004)
  4. Input

    These remarks on preparing input files for AgriPoliS focus mainly on the syntactic aspects of the input files. Only some limited information are provided regarding the meaning and preparation (calculation) of the data in the input files, as this is addressed in greater detail in 6.1.

    The following general remarks apply to all input files

      The input files should be simple text files. Special encodings (e.g. unicode) are not allowed.
      Every line starting with the sharp symbol # is a comment line. They are treated just as empty lines and therefore have no influence to the program.
      A line starting with the exclamation mark ! contains the column names of the table. The column names for columns which are necessary for the program must be kept unchanged. The necessary columns for such files are given in corresponding sections below. Additional columns can be added to the table without influence to the program, but they must have column names in the ! line. Consequently, if a file has a line starting with !, then the order of the columns is insignificant.
      The names of products, investments, rows and columns of the matrix are not allowed to contain spaces.

    1. Directory structure

      The input file has the following directory structure, the names of which are not allowed to change if their changeability is not explicitly mentioned in this document:

      farms (directory) contains an input file for each farm, in which every line is an initial investment.
      policy_settings.txt (The naming of this file is flexible.)
      scenario.txt (The naming of this file is flexible.)
    2. Farms folder
      This folder contains as many FarmName.txt files as typical farms are in the region. FarmName (in the file name) is the name of the Farm which should be the same as that appeared in farmsdata.txt.
      Necessary columns: Investition, Anzahl, Kapazitaet.
      Additinal columns make no difference for the program if they have column names in the !-line.
      If the value of FarmName is not the same as the file name (without the .txt extension) the program will give out a warning.
    3. MIP folder
      1.   capacityLinks
        1. Every row should have a capacity-link in this file.
        2. Note that a link of linktype invest in the capacity link has one more value than in objective function links or matrix links.
      2.   matrix_new
        1. Lines begin with # will be ignored as empty lines
        2. Structure of matrix
            a. Structure (The order is significant)
                _VARIABLES_ line (one line)
                _INTEGERS_ line (one line)
                restriction lines (more than one lines)
            b. Every line has a name, followed by some terms.
            c. Name and terms in the lines are separated by: tab, plus(+) or colon(:).
            d. Terms of each line can consist of several parts, which are separated by: spaces or commas (,).
        3. _VARIABLES_ line
            a. Name of the line: _VARIABLES_
            b. The order of the terms in this line is significant.
            The terms of this line can be:
            c. market.name._all_ , means all the names of products will be used.
            d. investments.name._all_, means all the names of investments will be used.
            e. otherNames, mean other free chosen names.
        4. _INTEGERS_ line
            a. Name of the line: _INTEGERS_
            Terms of this line can be:
            b. NameA, means the variable NameA from _VARIABLES_ is an integer variable.
            c. NameB=>NameC, means the variables from NameB to NameC (both inclusive) are integer variables.
        5. Restriction lines
        1. A restriction begins with a free chosen name (name of the row), followed by some terms. which can be:
        2. NameA , NameA=>NameB, {NameA=>NameB}. Meaning: The coefficients of these variables are 1.
        3. Factor*NameA, Factor* {NameA => NameB }, FactorList*{NameA=>NameB}. The Factor of FactorList are the coefficients of the corresponding variables. Factor should be a literal number, while FactorList should be a list of literal numbers.
        4. market.ColName._all_, Factor*market.ColName._all_ , investments.ColName._all_, Factor*investments.ColName._all_. The Coefficients of the variables from market or investments are that in the column ColName, possibly times an extra factor.
        5. market.ColName*NameA, market.ColName*{NameA=>NameB}, investments.ColName*NameA, investments.ColName*{NameA=>NameB}. Only partial names are used from market or investments.
        6. Factor*market.ColName*NameA, Factor*market.ColName*{NameA=>NameB}, Factor*investments.ColName*NameA, Factor*investments.ColName*{NameA=>NameB}. With extra factor.
        7. Factor*FactorList*{NameA=>NameB}. A short form for contiguous variable names.
        8. Implemented ColName for market: labour, initPrem; ColName for investments: labSub, capacity. Can be extended.
        9. matrixLinks.RestrictionName, _defaultLinks_.RestrictionName are just reminders for the modelling, the relevant values are taken care by the program from the input files for the links.
        10. The order of the parts in the terms is significant. Wrong terms: SOWS1*50, {SOWS1 => SOWS9}* investments.capacity
        11. Factor examples: 1, -1, (-1), 100.2, (-123.4)
        12. FactorLists are values in braces. examples: { 1, 2, 3, 4}, { -1, -2, 3, 4}, { 1 2 -5 -6.8}, {1 (-2) 3 (-4.2)}
        6. Example lines
            _VARIABLES_:     market.name._all_ + LU_UPPER_LIMIT + investments.name._all_ + DISINV_SOWS
            _INTEGERS_:    SOWS1 => OFFFARMLAB + DISINV_SOWS
            liquidity:    (-1 ) * ST_BORROW_CAP +1 *EC_INTEREST + matrixLinks.liquidity + _defaultLinks_.liquidity
            labour:    market.labour._all_ + (-1)* investments.labSub._all_ + (-6.5)*DISINV_SOWS
            extensive_cattle:    EXT_CATTLE + (-1)*investments.capacity*{ EXTCATTLE1 => EXTCATTLE3} + DISINV_SUCKLER
            fertilisation:   (-170) * {BARLEY=>MAIZE_SILAGE } +(-210)*INT_GRASS +(-100)*EXT_GRASS +30*SOWS +10*FATTENING_PIGS
                 +50*INT_CATTLE +50*EXT_CATTLE +100*DAIRY +(-221)*MANURE_SELL
            labour_for_premium:   (-1)*market.labour*{BARLEY=>SET_ASIDE} + (-1 )*market.labour*IDLE_ARABLE + (-1)*market.labour*IDLE_GRASS
            set_aside_max:    ( -1 ) * { 0.33, 0.33 0.33}* {BARLEY => RAPE_SEED } + (-0.33)*PROTEIN_PLANTS +(-0.33)*MAIZE_SILAGE +SET_ASIDE
            dairy:  DAIRY + (-1)*investments.capacity*{DAIRY1=>DAIRY5} + DISINV_DAIRY
      3.   matrixLinks
        1. For product columns the liquidity and financing rule links can be combined with the row name liquidity/financing_rule if the other parts of the links are the same.
        2. If a liquidity-link for an investment column has the following values
          linktype         invest
          valuetype       BE
          factor             1
          then the link can be omitted, since it will be automatically considered by the program, i.e. as a default matrix link.
        3. If a financing_rule-link for an investment column has the following values
          linktype         invest
          valuetype       LE
          factor             1
          then the link can be omitted, since it will be automatically considered by the program, i.e. as a default matrix link.
      4.   objFuncLinks
        1. A column name that does not appear as name of a product in market.txt or as name of an investment in investments.txt must have an entry in this file. Otherwise the program will print an error message and quit.
        2. If an objective function link for a product column has the following values
          linktype         market
          valuetype       GM
          factor             1
          then the link can be omitted, since it will be automatically considered by the program, i.e. as a default objective function link.
        3. If an objective function link for an investment column has the following values
          linktype         invest
          valuetype       AC
          factor             -1
          then the link can be omitted, since it will be automatically considered by the program, i.e. as a default objective function link.
    4. Demographics
      The "demographics" plug-in overrides the variables simulating generational renewal in the model's core version. In the demographics file, the researcher can define the:
      initial age distribution of the manager of corporate and family farms,
      age distribution of the new managers,
      probability that generational renewal will take place on a corporate farm and a family farm,
      age at which generational renewal will take place,
      age until which a farmer is allowed to farm if there is no successor,
      and a decrease in a farm's productivity, if they continue to farm after generational renewal, should occur if there is no successor.
    5. farmsdata
      1. The names in the first column are significant and should be kept unchanged.
      2. The names of the soil types must be exactly that in the file globals.txt.
      3. The rows for Carbon_mean and Carbon_std_dev are necessary only if HAS_SOILSERVICE is true in options.txt.
    6. globals
      1. Every line is a pair of name and value with the exception of the global Names_of_soil_types, which can have any number of values depending on the region under investigation.
      2. If LP_MOD is false in options.txt, then the following globals must be set (the values can be varied):
            lower_bound_low_tranch      0
            upper_bound_low_tranch      5000
            lower_bound_middle_tranch   5000
            upper_bound_middle_tranch   50000
            lower_bound_high_tranch     50000
            upper_bound_high_tranch     1000000000
      3. Otherwise, if LP_MOD is true in options.txt, then the tranch_X_width (X = 1, 2, 3, 4, 5) have to be set, e.g. (the values can be varied):
            trach_1_width    5000
            trach_2_width    95000
            trach_3_width    100000
            trach_4_width    100000
            trach_5_width    100000000
    7. investments
      1. Necessary coulumns: type, name, cost, life, labSub, landSub, capacity, maintenance, prodGroup, techChange.
      2. Additinal columns make no di?erence if they have column names in the!-line.
    8. market
      1. The value of premiumName in the first non-comment line is significant: There should be a row in the matrix (matrix.txt and capacityLinks.txt) with this name.
      2. The values in the 3 columns initPrem, refPrem and Xyears will not be considered by the program if the value of the column premium in the same line is false. For this case we usually use the - symbol, otherwise they must be numbers.
      3. Necessary columns: type, group, name, price, varCost, priceFlex, chageRate, producedByFarmType, LUperPlace, premium, initPrem, priceSupp, refPrem, Xyears.
      4. Additional columns make no difference if they have column names in the!-line.
    9. options
      1. An option has the following format:
        option name = option_value ;
        where the semicolon and the equal sign can be omitted, but there should be at least one space between the name and its value.
      2. The value (path) of INPUTFILEdir can be empty. Then it has the same value (path) as the options diretory, which is the first argument to AgriPoliS.
      3. The value of OUTPUTFILE can be empty. Then its value is outputfilesEXT, where EXT is derived from the name of the policy-file when running the program:
        (a) with policy_settings.txt EXT will be empty;
        (b) with PREpolicy_settingsPOST.txt EXT=POST;
        (c) with FIRSTPART.OTHER EXT=FIRSTPART;
        (d) with ANYNAME EXT=ANYNAME.
    10.     policy_settings
      1. Lines begin with # will be ignored as empty lines; spaces, tabulators are delimiters.
      2. Structure
        1. Policy for each iteration consists of the following lines
          ITERATION line
          PREMIUM line (optional)
          REF_PREM_PERCENT line (optional)
          PRICE_CHANGE line (optional)
          DECOUPLING line (optional)
          TRANCHING line (optional)
          OTHERS line (optional)
        2. The order of the optional lines is irrelevant.
        3. If all the optional lines are empty, the iteration line can also be removed. That is, not every iteration needs a policy line.
        4. If an element does not change, it needs not appear in the current policy.
      3. ITERATION line
        iteration num [some description ]

        Policy will be initialized with the policy of iteration 0.

      4. PREMIUM line
        premium: ( productName=val; )+
      5. REF_PREM_PERCENT line
        ref_prem_percent: ( productName=val; )+
      6. PRICE_CHANGE line
        price_change: ( productName=val; )+
      7. DECOUPLING line
        decoupling: [fully=val1;] [regional=val2;] [farmspecific=val3;]
        a. At least one of the decoupling should appear;
        b. val1, val2, val3 can be 0 or 1;
      8. TRANCHING line
        a. when LP_MOD is true (num can be 1 through 5):
        tranch: [tranch_num_deg=val; ]+
        b. when LP_MOD is false:
        tranch: [degression_low_tranch=val; ] [degression_middle_tranch=val; [degression_high_tranch=val;]
        c. val is a float number.
      9. OTHERS line
        others: [MAT_CELL RHS_ROW UB_COL ]+
        a. MAT_CELL
        mat_cell: colname, rowname = val;
        b. RHS_ROW
        rhs_row: rowname= (LE | GE | EQ ) ;
        c. UB_COL
        ub_col: colname= ( 0|INF);
      10. Examples
        iteration 0 initializing
        ref_prem_percent:   BARLEY=1; WINTER_WHEAT=1; RAPE_SEED=1; SUGAR_BEETS=1; PROTEIN_PLANTS=1; MAIZE_SILAGE=1;
             INT_GRASS=1; EXT_GRASS=1; INT_CATTLE=1; EXT_CATTLE=1; DAIRY=1; SET_ASIDE=1; IDLE_ARABLE=1; IDLE_GRASS=1;
        price_change:    V_HIRED_LABOUR_H = 1.005;V_OFF_FARM_LAB=1.005;
        # # others:    mat_cell
        iteration 3
        premium:      INT_GRASS=0; EXT_GRASS = 51; INT_CATTLE=206; EXT_CATTLE=313; DAIRY=131.4;
                SET_ASIDE=392; IDLE_ARABLE=0; IDLE_GRASS=0;
        price_change:    DAIRY=0.94;
        others:      mat_cell:LU,IDLE_GRASS = -0.7;
        iteration 4
        premium:      BARLEY=384; WINTER_WHEAT = 384; RAPE_SEED=384; SUGAR_BEETS=384; PROTEIN_PLANTS=439.57; MAIZE_SILAGE=384;
               INT_GRASS=44; EXT_GRASS=44; INT_CATTLE=0; EXT_CATTLE=0; DAIRY=0; SET_ASIDE=384; IDLE_ARABLE=384; IDLE_GRASS=44;
        ref_prem_percent:    BARLEY=0; WINTER_WHEAT=0; RAPE_SEED=0; SUGAR_BEETS=0; PROTEIN_PLANTS=0; MAIZE_SILAGE=0;
              INT_GRASS=0; EXT_GRASS=0; INT_CATTLE=0.67; EXT_CATTLE=0.64; SET_ASIDE=0; IDLE_ARABLE=0; IDLE_GRASS=0;
        decoupling:      regional=0; farmspecific=1; fully=0;
        tranch:      tranch_1_deg=0; tranch_2_deg=0.03; tranch_3_deg=0.03; tranch_4_deg=0.03; tranch_5_deg=0.03;
        price_change:     BARLEY=1.04; WINTER_WHEAT=1.04; RAPE_SEED=1.03; INT_CATTLE=1.06; EXT_CATTLE=1.06; DAIRY=1.06;
        others:      rhs_row:arable_land=EQ; rhs_row: pasture_land = EQ;
    11.    Scenario
      scenario.txt has the following format
      Scenario:    renting_strategy
      Description:    investigate the combinational effects of rent_adjust_factor and generation_change
      Policy_file:     policy_settings.txt
             
      [options]      
      Teiler       3
             
      [globals]
      rent_adjust_factor       0.5

      Where Scenario:, Description:, Policy_file:, [options] and [globals] are part of the format. The globals listed under [globals] and the options under [options] override the corresponding values in globals.txt and options.txt respectively. The scenario name will be in the output files.

  5. Output
    The output folder contains 5 files:
    farm_investment.dat: provides information about type and number of investments each farm has made during the simulation;
    farm_production.dat: provides information about which kind of agricultural products and how much each farm has produced during the simulation;
    farm_standard_indicators.dat: provides economic and financial for each farm during the simulation
    sec_prices.dat: provides information about development of prices introduced in the model for each product during the simulation
    sector.dat: provides economic, financial and agricultural information at the sectoral level
  6. How to
    1. Produce a model region

      The purpose of this guideline is to assist AgriPoliS users in the collection and preparation of data for the implementation of their region into AgriPoliS. This guideline is the documentation of the data collection process IAMO took in the implementation of the German NUTS 2 region, Weser-Ems, into AgriPoliS. It is broken into the following steps:

      1. Structural Data Collection
      2. Input Data Collection and Calculation
      3. Requirements and Restrictions Document
      4. Premium Distribution Document

      1.   Data for Farm Selection
        1.       Structural Data for Farm Selection

          Structural data is the basic statistical information, from which the structural composition of the region can be interpreted. With this data, the modelers have an idea of the typical farm structures in the region which serve to both assist the automated process of selecting typical farms and to verify the reality of the model in the automated upscaling process.

        2.       What data is required?
          What is absolutely necessary for AgriPoliS are the most recent statistics for the following indicators:
          1. Farm Types
          2. Full/part time Farm classifications
          3. Agriculturally used area (ha)
          4. Agriculturally used area by farm type (ha)
          5. Agricultural holdings with an agriculturally used area of ... to under ... ha
          6. Production structure number of livestock kept in stocks of ... to under ... Livestock Units (LU)

          Examples of the indicators accompanied by Weser-Ems data can be seen below in Table 3 .

          A few tips to keep in mind during the structural data collection:
          1. Be aware of how full and part time farms are classified in your structural data. Does it depend on the amount of labour needed? Or European Size Units (ESU)? The FADN uses ESU based on the country in which the farm is located.

          2. The purpose of this data is to represent the region ? do not simply fill in your regional statistics based on Weser-Ems structural data. The information should reflect the region. E.g. is there significant protein crop production? Add it under arable land.

          3. The size groupings listed below are relevant to depict Weser-Ems' structure. Please use size groups which best represent your region.

          Table 3 Weser-Ems Structural Data example (modified from Agrarstrukturhebung Niedersachsen 2013)
        3.       Where do I find this data?

          The structural data is typically gathered and published by a government agency. For the Weser-Ems region, the data is prepared and distributed by the Landesamt fuer Statistik Niedersachsen; the state statistical agency.

      2.   Inputs

        The three input files which are especially important for the creation of new model regions are the market, investments, and globals; explained in the following sections. These files provide the model with the financial information, production and investment options, and labour activities for the region. This data should be as recent as possible correspond to the year of your structural data. It should represent the typical or average of the region. For example, the price and costs of crop production can vary drastically across Germany based on the soil quality and typical machinery of the region. For this reason, it was important that we spoke with experts to confirm our numbers so that we were not representing the prices and costs of a region which produces under different circumstances.

        We suggest that users first collect data from stastical sources and then confirm this with local experts. For Weser-Ems, data was collected from various German statistics on agricultural business planning such as the KTBL and the Niedersachsen and Brandenburg Agricultural Ministries data collections. We realized that often such data sources provide ?best-practice? or data from the top-performing farms, what is neither representative nor helpful to model a region. After we gathered and calculated our inputs, we confirmed our inputs with regional experts. Confirming your data with regional experts will both ensure accuracy and enable you to learn more about the region, e.g. what the restrictions for production are; information that is necessary to produce the final inputs and calibrate the model to the new model region.

        1.       Market

          The market input file defines key production activities in the CS region. The file requires data on the costs and benefits associated with crop and animal production in your region. Here we are looking for what is typical or average in the CS region. This is particularly relevant for the prices, costs, and labour requirements, as they can vary across country and even within countries.

          If we take winter wheat production in Weser-Ems as an example, we need to know:

          Price on average, how much one earns selling one hectare's worth of winter wheat in the region
          Variable costs what are the typical costs to produce one hectare of winter wheat; this will consist of direct costs and variable machine costs for the region (Do not include overall machinery or buildings their tax or maintenance as these are calculated elsewhere.).
          Labour how many hours of labour are needed on average per hectare of winter wheat?
          (Coupled) Premiums are there premiums or subsidies associated with production? If so, is there a difference between the initial premium, what one earns in the first year of production, and the ongoing premiums, what one earns in the years after?

        2.        Investments

          The investment input file should reflect the typical investment options, which are stables and machinery, of the region. This also includes past and future investments. Past investments are the types of stables and machines that farms have and use now but would no longer be invested in today. Future investments are the stables and machinery that will likely be invested in in the future. Like in the markets, we are looking for the typical or average costs that farmers have in the region.

          Using sow stables as an example, we will need to know:

          Costs what is the total cost of this stable in euros
          Size / capacity how many animal places are there (How many sows can be in the stable at one time?)
          Maintenance the average yearly maintenance costs of the stable
          Life span how many years will the stable be used
          Labour requirements how many labour hours are required to run the stable

        3.        Globals

          The globals file contains general information which are used in the model.

          For AgriPoliS, globals vary from average annual milk yield per cow to average plot size. In the Excel document, GLOBALS, annotated explanations are provided of each variable that is foreseeably required for new region implementation. However, if you think that there is information that is relevant for your region but not being asked for, please document it in the requirements and restrictions, detailed in the following section.

      3.   Requirements and Restrictions Documentation

        In addition to the input files data, modelers need general information on requirements and restrictions of the region in order to capture the details of the regions in the matrix (see 4.3.2).

        This is for example necessary to capture the feeding requirements per animal:

        What is the feed makeup for each sort of livestock?
        How much of each fodder does each animal place require per year?
        Do farmers tend to buy the fodder or produce it themselves? Make sure that this is reflected in the market file; as commented, if your farmers purchase feed, include that in the costs, if they produce on farm, do not, but make sure it is reflected in the columns as a category & price= 0

        Regarding restrictions, modelers need to capture both general environmental production restrictions but also the unique socio-political-economic situations of the model region. For example, we have recently been introduced to a region where the local ministry will not give any building permits to farmers for livestock stables. This unique circumstance of the region drastically affects the investment possibilities, a core function of the model. Therefore the modelers must alter the input files in such a way that AgriPoliS understands the restrictions and models a version of the region which closely reflects reality.

        Some questions to think about in detailing the restrictions:

        What are the crop rotations requirements? For which crops? How do farmers tend to rotate?
        What are the regional ceilings?
        Livestock density
        Nitrogen production
        Fertilizer use
        Manure import and export
        Outside of the greening measures, are there legal restrictions about land use?
        What are some specific regulations and laws regarding:
        Land markets
        Farm succession / inheritance
        Are there additional environmental regulations or restrictions?

      4.   Premium Documentation

        As premiums play a strong role in EU agriculture, it is important to understand the premium distributions of each region. Some relevant questions might be:

        For what are premiums given?
        How much can farmers earn with the premiums in your area?
        Does the premium distribution change based on: time, the amount being produced, age of farmer, crop type, production circumstances?
        Do premiums have limits? E.g. there is a higher premium for the first ___ ha and the next ___ ha receive a lower premium and so on? Or the premium was only available for farmers starting in certain years and will expire after ____ year?
        What are specific conditions and regulations a farm has to obey in order to receive the premium?

      5.   Upscaling

        To adapt AgriPoliS to a new region a set of typical farms has to be selected. This is done through an upscaling process, where the model farm structure is created through model farms which represent the typical farms in the region so that the model regions reflects the real-world region. The process was automated by Sahrbacher and Happe (2008) and modernised for current technology as part of the AgriPoliS2020 project.

        Using anonymised FADN farms and the regional farm structural data, the upscaling program selects the fewest number of characteristic farms from the FADN sample to appear in the model region a certain number of times. These selected "typical farms" cumulatively result in a region closely resembling the farm structural data statistics.

        The quadratic integer optimisation problem can be represented mathematically as:

        $$\text{min}\quad \sum_i w_i (S_i-F_i)^2 $$ Where
        $F_i=\sum_kx_kP_{k,i}$
        $S_i$ : value of the i-th structure property
        $w_i$ : weight of the i-th structure property
        $x_k$ : frequency of k-th farm; integer values
        $P_{k,i}$ : contribution of k-th farm to $S_i$
    2. Run AgriPoliS

      To run AgriPoliS, you need

      Input files for a region (see 4). The folder inputfiles contains
      A folder farms containing as many text files as typical farms (region specific)
      A folder mip containing following text files: capacityLinks, matrix_new, matrixlinks and objFuncLinks
      Several other text files: demographics, farmsdata, globals, investments, market, options, policy_settings, scenario
      AgriPoliS source code or executable file (agpCC.exe) which will serve to run simulations
      A file called glpk_4_45.dll which the program needs for solving farms? optimization problems
      Batch file (.bat). Those files aim at starting your experiments.

      A Batch file to start AgriPoliS should look like this:

      start cmd /k D:\Users\YourName\YourFolder\AgriPoliS\src\agpCC\release\agpCC.exe D:\Users\YourName\YourFolder\YourRegion\inputfiles

      You can use Editor, Notepad++ or any equivalent software open and edit an existing batch file or to create your own. Please adjust the paths leading to the executable file agpCC.exe as well as to the folder inputfiles and save the file as ChooseAName.bat before you close it.

      All you have to do now is to double click on the batch file and there you go: The program will open a completely unspectacular black window where you can see that the program is initializing, in which iteration the simulation is and how many farms are still active.

      Output files will automatically be saved with the .dat extension in separated, automatically created outputfiles folder in the same folder where your inputfiles are saved (D:\Users\YourName\YourFolder\YourRegion ). The output folder contains 5 files:

      farm_investment.dat: provides information about type and number of investments each farm has made during the simulation;
      farm_production.dat: provides information about which kind of agricultural products and how much each farm has produced during the simulation;
      farm_standard_indicators.dat: provides economic and financial for each farm during the simulation
      sec_prices.dat: provides information about development of prices introduced in the model for each product during the simulation
      sector.dat: provides economic, financial and agricultural information at the sectoral level

    3. Run AgriPoliS with Repetitions

      It is recommended to run simulations with different initializations to assure the robustness of the results. To run simulations with repetitions, you need a batch-file and it has to look like this:

      echo off  
      set i=1
      set max=101
      set workdir=D:\Users\YourName\YourFolder\YourRegion
      set inputdir=%workdir%\inputfiles
      set scenario=scenario
      set ext=.txt
      set file=%inputdir%\%scenario%
      rem set ranfile=randomNumbers.txt
      rem set ran

      :start
      echo ============== Repeat %i% ==============
      if "%i%"=="%max%" goto end
      rem set ran=%RANDOM%
      rem echo %ran% >>%inputdir%\%ranfile%
      PowerShell "(GC %file%%ext% -Raw ) -Replace '_SEED_', %i% |SC %file%-%i%%ext%"
      %workdir%\agpCC-hoc.50.exe %inputdir% %scenario%-%i%%ext% %i%
      del %file%-%i%%ext%
      set /A i=%i%+1
      goto start
      :end

      With set i and set max you set the number of repetitions. This example will run 100 repetitions. It is necessary to specify the input variables that you want to vary with the different initializations in the scenario.txt file. They have to be indicated as follows:

      seed_demogFF     _SEED_  
      seed_demogCF _SEED_

      seed_demogNewAge _SEED_
      seed_mgmtCoeff _SEED_

      seed_farmAge _SEED_
      seed_closeFarm _SEED_
      seed_investAge _SEED_

      seed_contractLengthInit _SEED_
      seed_contractLength _SEED_

      seed_freePlot_initLand _SEED_
      seed_freePlot_rentPlot _SEED_

      Additionally, and in contrast to runs without repetitions , you need to create a folder for your output files under the same directory as your input folder, before you start the batch file. The folder needs to contain "outputfiles" and the name of the scenario that is indicated in the scenario.txt input file, both separated by an underscore: D:\Users\YourName\YourFolder\YourRegion\outputfiles_Yourscenario. This is not done automatically!

Developed by
Funded by
German Research Foundation
Powered by