This page was automatically generated by NetLogo 5.0.3.

The applet requires Java 5 or higher. Java must be enabled in your browser settings. Mac users must have Mac OS X 10.4 or higher. Windows and Linux users may obtain the latest Java from Oracle's Java site.


In order for this to work, this file, your model file (PolicyScape140525-Applet.nlogo), and the files NetLogoLite.jar and NetLogoLite.jar.pack.gz must all be in the same directory. (You can copy NetLogoLite.jar and NetLogoLite.jar.pack.gz from the directory where you installed NetLogo.)

On some systems, you can test the applet locally on your computer before uploading it to a web server. It doesn't work on all systems, though, so if it doesn't work from your hard drive, please try uploading it to a web server.

You don't need to include everything in this file in your page. If you want, you can just take the HTML code beginning with <applet> and ending with </applet>, and paste it into any HTML file you want. It's even OK to put multiple <applet> tags on a single page.

If the NetLogoLite files and your model are in different directories, you must modify the archive= and value= lines in the HTML code to point to their actual locations. (For example, if you have multiple applets in different directories on the same web server, you may want to put a single copy of the NetLogoLite files in one central place and change the archive= lines of all the HTML files to point to that one central copy. This will save disk space for you and download time for your users.)

powered by NetLogo

view/download model file: PolicyScape140525-Applet.nlogo

INSTALLATION AND RUNNING

ALTERNATIVE 1. Install the Netlogo modeling environment (Wilensky, 1999) on your computer and run the POLICYSCAPE agent-based model in Netlogo. NetLogo and further information can be obtained here:
http://ccl.northwestern.edu/netlogo/download.shtml
The POLICYSCAPE agent-based model can be downloaded from here:
http://policymix.nina.no/Portals/policymix/Documents/PolicyScape140525-Download.nlogo

ALTERNATIVE 2. Run the model in your web browser as an applet. Running the applet requires the Java Platform plugin of your browser to be enabled (this is usually the case by default, otherwise check under add-ons) and adding this website to Java’s “trusted sites”. In order to add it to Java’s “trusted sites”, go to the Java control center (e. g.: Windows-start-menu -> Programs -> Java -> “Configure Java” -> “Security”-tab -> “Edit Site List”), add the address of this website to the list and press okay. Then reload this website and the model should become visible above.

WHAT IS IT?

The POLICYSCAPE agent-based model (ABM) is a NetLogo (Wilensky, 1999) implementation of Pannell’s (2008) Public-Private Benefits framework (PPBF) to a spatially explicit policy mix in a landscape undergoing a forest transition (Barton and Adamowicz 2013). The purpose of the PPBF framework is to identify optimal policy instrument choices in the context of land-use change. These policy instruments encourage or discourage land-use change, depending on the relative weights of public and private interests in the possible forest and non-forest land-uses at a certain location.

The POLICYSCAPE model allows the user to explore how deviations from an optimal setting for implementing the PPBF at any given location plays out across a landscape over forest transition stages. Deviations include such things as imperfect knowledge on behalf of the policy maker responsible for instrument targeting, leading to path-dependency of policy instrument targeting and unintended effects over forest transition stages. (For details, please see below, section “Things to Notice: Analysis Strategies and Scenarios”!)

HOW IT WORKS

GENERAL INFORMATION:
The model proceeds through five stages of a forest transition, (1) the initial land-use pattern, (2) an export demand shock, (3) a stabilization under elevated demand, (4) a return to the original demand level, and (5) a final stabilization phase. In each phase, land-use agents, represented by grid cells on the land-use map, are called upon in random order. Land-use agents choose a forest or non-forest land-use state for their cell, depending the respective private benefits of these states. The private forest and non-forest benefits are called “FBPriv” and “NBPriv”, respectively. The corresponding public benefits are called “FBPubl” and “NBPubl”.

POLICY INSTRUMENTS:
If policy instruments are activated, the land-use agents’ choice is not only influenced by the immediate private benefits of different land-uses, but also by policy instruments offered by a policy maker. These instruments are:

  1. “-D”, an coercive incentive discouraging deforestation (e. g.: a protected area),
  2. “-DF”, a flexible incentive discouraging deforestation (e. g.: a payment for ecosystem services (PES) contract against deforestation),
  3. “+RF”, a flexible incentive encouraging re- or afforestation (e. g.: a payment for ecosystem services (PES) contract for re- or afforestation), and
  4. “+D/-R”, an incentive encouraging deforestation and discouraging re- or afforestation (e. g.: an agricultural subsidy).
    The policy maker chooses which instrument to apply to each cell, depending on the public and private benefits of the different land-use options. The policy maker’s choice to create a protected area is coercive and binding to the land-user. All other policy instruments are non-binding voluntary contract offers to pay the land-user for a certain land-use state. The contract is only accepted if the corresponding land-use state is chosen. Then it becomes binding for the specified contract duration.

MODEL PARAMETERS:
Parameter choices by the user can influence the distribution of public and private forest and non-forest benefits on the land-use map, the knowledge available to the policy maker, and the types of instruments from which the policy maker can choose.

HOW TO USE IT

RUNNING THE MODEL: (AUTOMATIC SCENARIOS)
To run the model, choose a scenario from the “scenario”-chooser, click on the button “Load Scenario” to set up the corresponding parameters, and click on the button “Full Run” to start the model. The model will progress through all five stages of the forest transition automatically. To go through the stages of the forest transition step by step, load a scenario, click on the button “Initialize” and click on “Step” to proceed one stage. Clicking “Step” again after the fifth stage restarts the model.

INTERPRETING MODEL RESULTS:
Results from model runs can be analyzed mainly by looking at the land-use map (left side of the interface), the two PPBF plots (right side of the interface), and the monitors located under the heading “Main Results”:

  1. The land-use map shows the land-use states of the all cells in the model. The color codes used are explained by the symbols under under the heading “Legend”.
  2. The two PPBF plots show the distribution of public and private net benefits of land-use change from a pre-deforestation (left PPBF plot) and a pre-reforestation perspective (right PPBF plot). The color codes are the same as on the land-use map.
  3. The “Main Results” monitors show key summary statistics, such as the sum of the public and private benefits from the current land-use states of all cells (“Sum of Benefits”), the sum of benefits minus the cost of paying all current policy instrument contracts (“Benefits - Costs”), the correlation of benefits and costs on forest cells (“Forest BC Corr.”), and a number of cells counts, filtered according to various criteria (e. g.: “Conflict. Offers”, showing the number of cells, which are under one contract, but to which another contract has been offered in the meantime).

MANUAL SCENARIOS:
The user can adjust scenarios via the controls found under the headings “Main Controls”, “Scenario Parameters”, and “Policy Instrument Duration by Stage”:

MAIN CONTROLS: Besides the aspects outlined under “Running the model” the main controls allow the user to choose the map mode (“map_mode”) and the style of the visualization of the map (“color_shading_by”).

  1. Map mode: The user can choose between: Either (1) a map that has the private non-forest and forest benefits (“NBPriv” and “FBPriv”) on the x- and y-axes. In this map the public benefits (“NBPubl” and “FBPubl”) are two independent random uniform distributions across the map. Or (2) a map that has the soil quality (Ricardian land concept) on the x-axis and the distance to the agricultural product market (von Thuenen land concept) on the y-axis. In this second map, “NBPriv” is influenced by both characteristics, whereas “FBPubl” can be correlated with soil quality (see below, “scenario parameters”). The other benefit dimensions are distributed randomly.
  2. Color Shading: By default, the land-use map uses one color value per land-use and instrument in order increase the clarity of land-use patterns. To obtain additional information, different settings of “color_shading_by” let the map display the public or private net benefits of forest by different shadings of the original color values. Choose a setting under “color_shading_by” and click the “Initialize” button to see the starting distribution of public and private benefits across the map.

SCENARIO PARAMETERS: These parameters allow the user to determine: (1) The knowledge of the policy maker about the benefit characteristics of different cells and the assumptions the policy maker uses in the absence of information (“Policy Maker Assumptions”), (2) the correlations between different benefit dimensions on the map (“Correlations btw. Benefits”), (3) whether certain benefits are homogenous across the whole map (“Benefit Homogeneity”), (4) which percentage of the value of primary forest reforested land has and whether the value of different benefits increases with their scarcity (“Reforestation and Scarcity”), and (5) the types of different policy instruments available to the policy maker (“Policy Instrument Type”).

These characteristics co-determine benefits, instrument targeting and allow you to evaluate their importance for policymix-path dependency

Policy-maker assumptions:
The policy-makers knowledge about any particular forest or non-forest private or public benefit of landuse change can be adjusted.
1. “Actual value”: the policy-maker knows the actual benefit on any land unit in the map given the actual landuse
2. “Mean”: the policy-maker assumes the mean value of benefits on land units of the same landuse type
3. “Zero”: the policy-maker assumes the landunit has zero benefits for a particular landuse type and benefit type
4. “One”: the policy maker assumes a constant benefit of one (the maximum benefit possible in the synthetic landscape is 1 if there is no scarcity and 2 if there is scarcity (see below))

Correlations between Benefits:
Correlations between public and private, forest and non-forest benefits describe some stylized characteristics of ecosystem functional relationships between biodiversity and ecosystem services. These factors introduce indirect effects of landscape heterogeneity into the model.
1. “FBPubl_corr_to_SoilQual” - e.g. suggests that biodiversity of forests can be positively correlated with soil quality
2. “FBPubl_corr_to_NBPriv” - e.g. currently forested land with high carbon storage has high value for conversion to slash-and-burn private crop land
3. “FBPriv_corr_to_FBPubl” - e.g. high use of forest provisioning services by forest dwellers in high biodiversity, high biomass forest
4. “NBPubl_corr_to_NBPriv” - e.g. high private value agricultural land entails high social benefits of employment and tax income to the public sector

Benefit Homogeneity:
Heterogeneity of public, private, forest and non-forest benefits may be adjusted to reflect stylized gradients in a landscape due to local topography, climate and endemism.
1. “On”: homogenous
2. “Off”: uniform random distribution

Reforestation and Scarcity:
“Reforest_value” – adjust whether reforested land is equally valuable to primary forest in terms of private and public benefits of forest
Scarcity factors simulate whether markets are open (no scarcity) or closed endogenous.
1. “FBPubl_scarcity_factor” - “On”: public forest value increases proportionally with the inverse number of forest landunits left (reflecting the value of ecosystem services being scarce at landscape scale ); “Off”: no scarcity of ecosystem services of forest reflecting the ability to substitute landscape level ecosystem services for (imported) man-made alternatives
2. “NBPubl_scarcity_factor” - “On”: public non-forest value increases with the inverse number of non-forest landunits left reflecting e.g. scarcity of social value of employment; “Off”: non-forest landuse social value is constant per landunit
3. “NBPriv_scarcity_factor” - “On”: scarcity of agricultural products from non-forest land due to endogenous local crop market; “Off”: open agricultural market

Policy Instrument Type:
Refers to the type of incentive and how total instrument costs are determined.
1. “Protected area” refers to a coercive incentive with no payment and no budgetary expense.
2. “Externality value” is an incentive offered according to the value of public forest benefit.
3. “Compensation PES” is an incentive equivalent to opportunity costs of conservation.

POLICY INSTRUMENT DURATIONS: Each of the input fields under this heading allows the user to enter the duration for which contracts are made for a certain policy instrument during a certain stage. E. g.: The second line of input fields refers to the flexible anti-deforestation PES-instrument “-DF”. Entering “5” into the first field of that line and “0” into all others, means that PES contracts will only be concluded in stage 1. These contracts last for 5 stages (until the end of the model run), but no new contracts will be concluded afterwards. This allows the user to explore the importance of time limited contracts and policy flexibility for path dependence of the landscape mosaic.

THINGS TO NOTICE: ANALYSIS STRATEGIES & SCENARIOS

ANALYSIS STRATEGIES: The core theme of the analyses possible with the POLICYSCAPE model is unintended effects in policy targeting and landscape scale and over long time frames. Two guiding questions for investigating these unintended effects are suggested: (1) Which deviations from the standard PPBF targeting pattern (see Scenario 1) occur under different deviations from the assumptions of the PPBF? (Here, the core interest is in investigating the relationship between limited policy maker knowledge and correlations in the benefit dimensions.) (2) If the policy maker does not know the actual value of a benefit dimension, which assumption (“mean”/“zero”/“one”) yields the highest total benefit? How does this change, depending on the underlying scenario assumptions?

SCENARIOS: (NOTE: After choosing a scenario, don’t forget to click “Load Scenario”!)

  1. SCENARIO 0: Illustrates the general model dynamics across the forest transition stages. Note how the orange agricultural area expands further into the green forest on the land-use map as well as in the PPBF plots as the export demand shock raises the crop price. Even though this development seems to take place in an instant, it is actually the result of each cell being called upon in a random order and deciding which land-use is the most profitable for it under the current circumstances.

  2. SCENARIO 1: Shows the replication of the PPBF targeting pattern in the POLICYSCAPE model. It is visible on the PPBF plots that the policy maker targets instruments to those cells where the private interests alone do not reflect the public benefits sufficiently. Notice how the benefit-cost-correlation on forest cells (“Forest BC Corr.”) increases as more and more policy instruments are applied! At a value of around 0.5, no further improvement via policy instruments is possible, since public benefits only make up for half of the benefits.

  3. SCENARIOS 2: Shows under which assumptions even the optimal PPBF targeting leads protected areas (PAs) to be allocated “high and far”. Note that only half of the forest deforested in stage 2 is restored in stage 4, since the reforestation value is set to only 75 % of the original forest value. Scenario (2b.) shows the interaction between PES contracts and PAs via forest cells saved across the transition stages.

  4. SCENARIOS 3: Shows an interaction of policy instruments via “scarcity factors”. If a “…_scarcity_factor?”-parameter is switched “on”, the value of the corresponding benefit increases linearly as the benefit becomes more scarce on the land-use map. The two scenarios show how agricultural subsidies in one place can increase the need for forest conservation elsewhere, if scarcity plays a role. At the end of a full run of scenario (3a.), in which only conservation instruments are applied, the number of cells under conservation instruments (“PES&PA cells”) is around 700. In contrast, scenario (3b.) also applies agricultural subsidies. In stage 5 of scenario (3b.), the number of “PES&PA cells” is around 1,200, illustrating the instrument interaction.

  5. SCENARIOS 4: Shows expected and unexpected effects of limited policy maker knowledge. The policy maker is faced with the standard situation of scenario (1.), except that public forest benefits are perfectly correlated to private non-forest production factors, such as soil quality, (“FBPubl_corr_to_NBPriv” = 1) and the reforestation value is only 75 % of the value of primary forest (“reforest_value” = 0.75). In order to obtain a baseline result, conduct a full model run under scenario (4a.). In stage 5 the monitor “Benefits - Costs”, indicating the total benefits on the map minus the implementation costs, should show a value around 9,700. Scenario (4b.) shows the expected effect of limited policy maker knowledge. The setup is the same as under scenario (4a.), except that the policy maker only knows the mean “FBPubl”. “Benefits - Costs” in stage 5 end up at around 9,400. Compared to the baseline, this is a negative effect of limited knowledge. In contrast, (4c.) shows an unexpected effect of ignorance. The policy maker only knows the “mean” “NBPriv”, but ends up with “Benefits - Costs” of around 10,300, meaning that under certain circumstances, even ignoring information that is available can prove beneficial. The reason can be found in the path dependency of the forest transition. Policies optimal for the high demand stages might not be optimal for the low demand stages. However, since the reforestation value is clearly below the value of primary forest, targeting less precisely during stages 2 and 3 can improve the situation in stages 4 and 5.

  6. SCENARIOS 5: Scenarios 5 illustrate the second synthetic map type available, which takes one step towards the analysis of real landscapes by allocating a range of soil qualities on the x-axis of the map and the agricultural market distance on the y-axis (map_mode = “X: Soil Quality, Y: Market Distance”). Scenarios (5a.) and (5b.) are chosen to illustrate how much the policy maker’s instrument choices can differ under varying assumptions about the landscape’s properties and the policy maker’s knowledge of them. Note the inefficiency of conservation targeting in scenario (5a.), with “-D” and “-DF” ranging far across the x-axis beyond which the public interest would mandate deforestation. In scenario (5b.), agricultural subsidies are similarly inefficient.

THINGS TO TRY

The model provides various possibilities for experimentation. The analysis strategies outlined under “Things to Notice” can provide some orientation on how to start:

  1. Look at the PPBF plots under scenario (1.) to see how the different policy instruments are optimally targeted. Then modify some of the “Correlations btw. Benefits” and “Policy Maker Assumptions”. Can you explain, why certain deviations from an optimal policy targeting occur?

  2. The scenario parameters can also be used to create very stylized versions of real world land-use policy challenges. If you can think of a real world case of land-use policy, you can try framing it in terms of the model. Do the results surprise you? Examples of how to translate real world observations into model assumptions: Are the most biodiverse forest habitats also on the most economically valuable land or not (“FBPubl_corr_to_SoilQual” or “FBPubl_corr_to_FBPriv”)? Is it more important for the government’s land-use policy to support marginal farms or to support the most profitable farms (“NBPubl_corr_to_NBPriv”)? Does the policy maker know each land-user’s opportunity cost of conservation or just the general profitability of agriculture (“NBPriv_policymaker_assumes”)? Do land-users value forest more for its location-specific habitat value or for its supply of timber, which might be relatively homogenous across the landscape (“FBPriv_is_homogenous?”)? Do local markets have a great influence on agricultural prices, or are they determined by the world market (“NBPriv_scarcity_factor?”)?

  3. Starting from a situation, where you assume that the policy maker cannot observe the actual value of one or several benefit dimensions, can you find out which assumption (“mean”/“zero”/“one”) yields the highest total benefits (minus costs)? Can you explain why?

CREDITS AND REFERENCES

Barton, D. N. and W. L. V. Adamowicz (2013). Path-dependent policyscapes: a theoretical approach to the evaluation of policymixes for biodiversity conservation. ESEE 2013 Conference : Ecological Economics and Institutional Dynamics. 10th biennal conference of the European Society for Ecological Economics., 18-21 Jun 2013 Lille (France).

Pannell, D.J. (2008), ‘Public benefits, private benefits, and policy mechanism choice for land-use 33 change for environmental benefits.’, Land Economics 84 (2), 225-40.

Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

CONTACTS

Netlogo code: Christian Klassert christian.klassert@ufz.de

Policymix project: David N. Barton david.barton@nina.no

Copyright 2014

CODE

globals
[
  stage
  read_-D_stages
  read_-DF_stages
  read_+RF_stages
  read_+D/-R_stages
  read_price_stages
  price
  sum_of_benefits
  count_LU0
  count_LU1
  count_LU2
  count_LU3
  total_NBPriv
  total_NBPubl
  total_FBPriv
  total_FBPubl
  -D_cost
  -DF_cost
  +RF_cost
  +D/-R_cost
  
  -D_patch_count
  -DF_patch_count
  +RF_patch_count
  +D/-R_patch_count
  PI_BC_correlation
  PI_B_variance
  PI_C_variance
  OS_BC_correlation
  OS_B_variance
  OS_C_variance
  Forest_BC_correlation
  
  reforestation_marker_turtle
  overlap_count
  conflicting_offers_count
  luc_count
  benefits_from_all_stages
  costs_from_all_stages
  initialized?
]

patches-own
[
  ;prev_land_use
  land_use
  NBPriv_base
  pot_NBPriv
  NBPriv
  NBPubl_base
  pot_NBPubl
  NBPubl
  FBPriv_base
  pot_FBPriv
  FBPriv
  FBPubl_base
  pot_FBPubl
  FBPubl
  -D_value
  -DF_value
  +RF_value
  +D/-R_value  
  -D_timer
  -DF_timer
  +RF_timer
  +D/-R_timer
  
  soil_quality
  market_distance
  -D_offer
  -DF_offer
  +RF_offer
  +D/-R_offer
  prev_land_use
]



;; ###########################
;; ### 1. Setup Procedures ###
;; ###########################

to setup
  ca
  setupGlobals
  ask patches
  [setupPatch]
  set initialized? true
end

to setupGlobals
  set stage -1
  set price 1
  crt 1 [set hidden? true set shape "dot" set color white set reforestation_marker_turtle self]
  setupPlots
end

to setupPatch
  setupPubl&PrivBenefits
  calcPotPubl&PrivBenefits
  set land_use 1
  landUseImplementation
end

to setupPubl&PrivBenefits
  if map_mode = "X: Soil Quality, Y: Market Distance"
  [
    set soil_quality ((pxcor + 1) / (max-pxcor + 2))
    set market_distance ((pycor + 1) / (max-pycor + 2))
    ifelse NBPriv_is_homogenous?
    [set NBPriv_base 0.5]
    [set NBPriv_base (soil_quality * (1 - market_distance))]
    ifelse FBPubl_is_homogenous?
    [set FBPubl_base 0.5]
    [
      set FBPubl_base ((1 - FBPubl_corr_to_SoilQual) * (random-float 1)) + (FBPubl_corr_to_SoilQual * soil_quality)
      if FBPubl_corr_to_SoilQual < 0 [set FBPubl_base ((1 + FBPubl_corr_to_SoilQual) * (random-float 1)) - (FBPubl_corr_to_SoilQual * (1 - soil_quality))]
    ]
    ifelse FBPriv_is_homogenous?
    [set FBPriv_base 0.5]
    [
      set FBPriv_base ((1 - FBPriv_corr_to_FBPubl) * (random-float 1)) + (FBPriv_corr_to_FBPubl * FBPubl_base)
      if FBPriv_corr_to_FBPubl < 0 [set FBPriv_base ((1 + FBPriv_corr_to_FBPubl) * (random-float 1)) - (FBPriv_corr_to_FBPubl * (1 - FBPubl_base))]
    ]
  ]
  if map_mode = "X: NBPriv, Y: FBPriv"
  [
    ifelse NBPriv_is_homogenous?
    [set NBPriv_base 0.5]
    [set NBPriv_base ((pxcor + 1) / (max-pxcor + 2))]
    ifelse FBPubl_is_homogenous?
    [set FBPubl_base 0.5]
    [
      set FBPubl_base ((1 - FBPubl_corr_to_NBPriv) * (random-float 1)) + (FBPubl_corr_to_NBPriv * NBPriv_base)
      if FBPubl_corr_to_NBPriv < 0 [set FBPubl_base ((1 + FBPubl_corr_to_NBPriv) * (random-float 1)) - (FBPubl_corr_to_NBPriv * (1 - NBPriv_base))]
    ]
    ifelse FBPriv_is_homogenous?
    [set FBPriv_base 0.5]
    [
      set FBPriv_base ((1 - FBPriv_corr_to_FBPubl) * ((pycor + 1) / (max-pycor + 2))) + (FBPriv_corr_to_FBPubl * FBPubl_base)
      if FBPriv_corr_to_FBPubl < 0 [set FBPriv_base ((1 + FBPriv_corr_to_FBPubl) * ((pycor + 1) / (max-pycor + 2))) - (FBPriv_corr_to_FBPubl * (1 - FBPubl_base))]
    ]
  ]
  ifelse NBPubl_is_homogenous?
  [set NBPubl_base 0.5]
  [
    set NBPubl_base ((1 - NBPubl_corr_to_NBPriv) * (random-float 1)) + (NBPubl_corr_to_NBPriv * NBPriv_base)
    if NBPubl_corr_to_NBPriv < 0 [set NBPubl_base ((1 + NBPubl_corr_to_NBPriv) * (random-float 1)) - (NBPubl_corr_to_NBPriv * (1 - NBPriv_base))] 
  ]
end



;; ########################
;; ### 2. Go Procedures ###
;; ########################

to go
  if stage > 4 [setup stop]
  set stage stage + 1
  ask patches [updateTimers]
  set luc_count 1
  let i 1
  while [i <= max_steps_per_stage and luc_count > 0]
  [ 
    updateVariablesBeforeDecision
    setupPlots
    ask patches
    [
      clearOldLandUse
      landUseDecision
      landUseImplementation
    ]
    updateVariablesAfterDecision
    display
    set i i + 1
  ]
  set benefits_from_all_stages benefits_from_all_stages + sum_of_benefits
  set costs_from_all_stages costs_from_all_stages + (-D_cost + -DF_cost + +RF_cost + +D/-R_cost)
end

to updateTimers
  set -D_timer max (list 0 (-D_timer - 1))
  set -DF_timer max (list 0 (-DF_timer - 1))
  set +RF_timer max (list 0 (+RF_timer - 1))
  set +D/-R_timer max (list 0 (+D/-R_timer - 1))
  if -D_timer = 0 [if -D_value > 0 [set -D_cost -D_cost - -D_value] set -D_value 0]
  if -DF_timer = 0 [if -DF_value > 0 [set -DF_cost -DF_cost - -DF_value] set -DF_value 0]
  if +RF_timer = 0 [if +RF_value > 0 [set +RF_cost +RF_cost - +RF_value] set +RF_value 0]
  if +D/-R_timer = 0 [if +D/-R_value > 0 [set +D/-R_cost +D/-R_cost - +D/-R_value] set +D/-R_value 0]
end

to updateVariablesBeforeDecision
  ; ask turtles [die]
  clear-drawing
  readInstrumentLists
  set luc_count 0
end

to updateVariablesAfterDecision
  set sum_of_benefits (total_NBPriv + total_FBPriv + total_NBPubl + total_FBPubl) ; sum [NBPubl + FBPubl + NBPriv + FBPriv] of patches
  set -D_patch_count (count patches with [-D_timer > 0])
  set +D/-R_patch_count (count patches with [+D/-R_timer > 0])
  ;set overlap_count (count patches with [pcolor > 0 and pcolor < 10])
  set conflicting_offers_count (count patches with [pcolor > 0 and pcolor < 10]) ;(count patches with [pcolor > 10 and pcolor < 20])
  calcCorrelations
end

to clearOldLandUse
  if land_use = 0 [set count_LU0 count_LU0 - 1]
  if land_use = 1 [set count_LU1 count_LU1 - 1]
  if land_use = 2 [set count_LU2 count_LU2 - 1]
  if land_use = 3 [set count_LU3 count_LU3 - 1]
  set total_NBPriv total_NBPriv - NBPriv
  set total_NBPubl total_NBPubl - NBPubl
  set total_FBPriv total_FBPriv - FBPriv
  set total_FBPubl total_FBPubl - FBPubl
  
  if -D_timer > 0 [set -D_cost -D_cost - -D_value]
  if -DF_timer > 0 [set -DF_cost -DF_cost - -DF_value]
  if +RF_timer > 0 [set +RF_cost +RF_cost - +RF_value]
  if +D/-R_timer > 0 [set +D/-R_cost +D/-R_cost - +D/-R_value]
end 

to landUseDecision
  calcPotPubl&PrivBenefits
  
  ;; Calculate policy maker benefit expectations
  let enbpriv (calcPolicyMakerExpectation NBPriv_policymaker_assumes pot_NBPriv (price * total_NBPriv) count_LU3) ;[pmassumes potben totalben cellno]
  let enbpubl (calcPolicyMakerExpectation NBPubl_policymaker_assumes pot_NBPubl total_NBPubl count_LU3)
  let efbpriv (calcPolicyMakerExpectation FBPriv_policymaker_assumes pot_FBPriv total_FBPriv (count_LU1 + count_LU2))
  let efbpubl (calcPolicyMakerExpectation FBPubl_policymaker_assumes pot_FBPubl total_FBPubl (count_LU1 + count_LU2))
  if land_use != 1 
  [set efbpriv (calcPolicyMakerExpectation FBPriv_policymaker_assumes pot_FBPriv (reforest_value * total_FBPriv) (count_LU1 + count_LU2))
    set efbpubl (calcPolicyMakerExpectation FBPubl_policymaker_assumes pot_FBPubl (reforest_value * total_FBPubl) (count_LU1 + count_LU2))]
  
  ;; Determine policy maker offers
  ifelse -D_timer = 0
  [
    ifelse (land_use = 1 OR land_use = 2)
    and item (min (list 5 stage)) read_-D_stages > 0
    and (efbpubl - enbpubl) >= (enbpriv - efbpriv)
    and (enbpriv - efbpriv) >= 0 ;>=
    [
      ifelse -D_is = "externality-value PES"
      [set -D_offer (efbpubl - enbpubl)]
      [set -D_offer (enbpriv - efbpriv)]
    ]
    [set -D_offer 0]
  ]
  [set -D_offer -D_value]
  
  ifelse -DF_timer = 0
  [
    ifelse (land_use = 1 OR land_use = 2)
    and item (min (list 5 stage)) read_-DF_stages > 0
    and (efbpubl - enbpubl) < (enbpriv - efbpriv)
    and (efbpubl - enbpubl) >= 0 ;>=
    [
      ifelse -DF_is = "externality-value PES"
      [set -DF_offer (efbpubl - enbpubl)]
      [set -DF_offer (enbpriv - efbpriv)]
    ]
    [set -DF_offer 0] 
  ]
  [set -DF_offer -DF_value]
  
  ifelse +RF_timer = 0
  [
    ifelse (land_use = 0 OR land_use = 3)
    and item (min (list 5 stage)) read_+RF_stages > 0
    and (efbpubl - enbpubl) >= (enbpriv - efbpriv)
    and (enbpriv - efbpriv) >= 0 ;>=
    [
      ifelse +RF_is = "externality-value PES"
      [set +RF_offer (efbpubl - enbpubl)]
      [set +RF_offer (enbpriv - efbpriv)]
    ]
    [set +RF_offer 0]
  ]
  [set +RF_offer +RF_value]
  
  ifelse +D/-R_timer = 0
  [
    ifelse item (min (list 5 stage)) read_+D/-R_stages > 0
    and (enbpubl - efbpubl) >= (efbpriv - enbpriv)
    and (efbpriv - enbpriv) >= 0 ;>=
    [
      ifelse +D/-R_is = "externality-value subsidy"
      [set +D/-R_offer (enbpubl - efbpubl)]
      [set +D/-R_offer (efbpriv - enbpriv)]
    ]
    [set +D/-R_offer 0] 
  ]
  [set +D/-R_offer +D/-R_value]
  
  ;; Compile list of land-user benefits for all land-use options
  let lu-option-list (list [0 0] (list (pot_NBPriv + +D/-R_offer) 3)) ;- FBPriv_base
  ifelse land_use = 1 
  [set lu-option-list fput (list (pot_FBPriv + -D_offer + -DF_offer) 1) lu-option-list]
  [set lu-option-list fput (list (pot_FBPriv + -D_offer + -DF_offer + +RF_offer) 2) lu-option-list] ;- NBPriv_base
  
  ;; Change benefit list if there is a binding contract
  if (-D_timer > 0) OR (-D_is = "protected area" and -D_offer > 0)
  [
    ifelse land_use = 1 
    [set lu-option-list (list (list (pot_FBPriv + -D_offer) 1))]
    [set lu-option-list (list (list (pot_FBPriv + -D_offer) 2))]
  ]
  if (-DF_timer > 0)
  [
    ifelse land_use = 1
    [set lu-option-list (list (list (pot_FBPriv + -DF_offer) 1))]
    [set lu-option-list (list (list (pot_FBPriv + -DF_offer) 2))]
  ]
  if (+RF_timer > 0)
  [
    ifelse land_use = 1
    [set lu-option-list (list (list (pot_FBPriv + +RF_offer) 1))]
    [set lu-option-list (list (list (pot_FBPriv + +RF_offer) 2))]
  ]
  if (+D/-R_timer > 0)
  [
    set lu-option-list (list (list (pot_NBPriv + +D/-R_offer) 3))
  ]
  
  ;; Choose land-use option
  set land_use item 1 first sort-by [item 0 ?1 > item 0 ?2] shuffle lu-option-list
end

to calcPotPubl&PrivBenefits
  set pot_NBPriv (price * NBPriv_base)
  if map_mode = "X: Soil Quality, Y: Market Distance" AND NBPriv_is_homogenous? = false
  [set pot_NBPriv soil_quality * (price - market_distance)]
  if NBPriv_scarcity_factor?
  [set pot_NBPriv pot_NBPriv * (2 * (count_LU0 + count_LU1 + count_LU2) / (world-width * world-height))]  
  set pot_NBPubl NBPubl_base
  if NBPubl_scarcity_factor? [set pot_NBPubl pot_NBPubl * (2 * (count_LU0 + count_LU1 + count_LU2) / (world-width * world-height))]
  set pot_FBPriv FBPriv_base
  if land_use != 1 [set pot_FBPriv (reforest_value * pot_FBPriv)]
  set pot_FBPubl FBPubl_base
  if FBPubl_scarcity_factor? [set pot_FBPubl pot_FBPubl * (2 * (count_LU0 + count_LU3) / (world-width * world-height))]
  if land_use != 1 [set pot_FBPubl (reforest_value * pot_FBPubl)]
end

to-report calcPolicyMakerExpectation [pmassumes potben totalben cellno]
  let i potben
  if pmassumes = "mean" [ifelse cellno = 0 [set i 0] [set i (totalben / cellno)]]
  if pmassumes = "zero" [set i 0]
  if pmassumes = "one" [set i 1]
  report i
end

to landUseImplementation
  if land_use = 0
  [
    set NBPubl 0
    set FBPubl 0
    set NBPriv 0
    set FBPriv 0
    set count_LU0 count_LU0 + 1
    set pcolor black
    
    set -D_timer 0
    set -DF_timer 0
    set +RF_timer 0
    set +D/-R_timer 0
  ]
  if land_use = 1 or land_use = 2
  [
    set NBPubl 0
    set FBPubl pot_FBPubl
    set NBPriv 0
    set FBPriv pot_FBPriv
    ifelse land_use = 1 
    [set count_LU1 count_LU1 + 1]
    [set count_LU2 count_LU2 + 1
      markReforestation]
    set total_FBPriv total_FBPriv + FBPriv
    set total_FBPubl total_FBPubl + FBPubl
    set pcolor green
    ifelse ((-D_offer + -DF_offer + +RF_offer) > max (list -D_offer -DF_offer +RF_offer))
    [
      if (max (list -D_timer -DF_timer +RF_timer) <= 0)
      [show "Error!"]
      if -D_timer > 0 [set -D_value -D_offer]
      if -DF_timer > 0 [set -DF_value -DF_offer]
      if +RF_timer > 0 [set +RF_value +RF_offer]
    ]
    [
      set -D_value -D_offer
      set -DF_value -DF_offer
      set +RF_value +RF_offer
    ]
        
    if -D_value > 0
    [
      set pcolor yellow
      if -D_timer = 0 [set -D_timer (item (min (list 5 stage)) read_-D_stages)]
      set -D_cost -D_cost + -D_value
    ]
    if -DF_value > 0
    [
      set pcolor blue
      if -DF_timer = 0 [set -DF_timer (item (min (list 5 stage)) read_-DF_stages)]
      set -DF_cost -DF_cost + -DF_value
    ]
    if +RF_offer > 0
    [
      set pcolor violet
      if +RF_timer = 0 [set +RF_timer (item (min (list 5 stage)) read_+RF_stages)]
      set +RF_cost +RF_cost + +RF_value
    ]
    if ((-D_timer + -DF_timer + +RF_timer) > max (list -D_timer -DF_timer +RF_timer))
      [set pcolor gray]  
    
    set +D/-R_timer 0
  ]
  if land_use = 3
  [
    set NBPubl pot_NBPubl
    set FBPubl 0
    set NBPriv pot_NBPriv
    set FBPriv 0
    set count_LU3 count_LU3 + 1
    set total_NBPriv total_NBPriv + NBPriv
    set total_NBPubl total_NBPubl + NBPubl
    set pcolor orange
    if +D/-R_offer > 0
    [
      set pcolor magenta
      set +D/-R_value +D/-R_offer
      if +D/-R_timer = 0 [set +D/-R_timer (item (min (list 5 stage)) read_+D/-R_stages)]
      set +D/-R_cost +D/-R_cost + +D/-R_value
    ]

    set -D_timer 0
    set -DF_timer 0
    set +RF_timer 0
  ]
  
  if land_use != prev_land_use [set luc_count luc_count + 1]
  set prev_land_use land_use
  
  if (max (list -D_timer -DF_timer +RF_timer +D/-R_timer) > 0)
  and ((-D_offer + -DF_offer + +RF_offer + +D/-R_offer) > max (list -D_offer -DF_offer +RF_offer +D/-R_offer))  
  [set pcolor grey + 1]
  plotIndividualDot
  if pcolor != grey + 1 [colorShading]
end



;; ########################
;; ### 3. Miscellaneous ###
;; ########################

to readInstrumentLists
  set read_-D_stages (list -D_0 -D_1 -D_2 -D_3 -D_4 -D_5)
  set read_-DF_stages (list -DF_0 -DF_1 -DF_2 -DF_3 -DF_4 -DF_5)
  set read_+RF_stages (list +RF_0 +RF_1 +RF_2 +RF_3 +RF_4 +RF_5)
  set read_+D/-R_stages (list +D/-R_0 +D/-R_1 +D/-R_2 +D/-R_3 +D/-R_4 +D/-R_5)

  carefully [set read_price_stages read-from-string price_stages] [correctListErrorPrice]
  if not is-list? read_price_stages [correctListErrorPrice]
  if length read_price_stages < 6 [correctListErrorPrice]
  set price item (min (list 5 stage)) read_price_stages
end

to correctListErrorPrice
  user-message "Wrong list format corrected! (price_stages)" set read_price_stages [1 1 2 2 1 1] set price_stages "[1 1 2 2 1 1]"
end

to calcCorrelations
  ;let forest-patches patches with [land_use = 1 OR land_use = 2]
  let pi-patches patches with [-D_timer > 0 OR -DF_timer > 0 OR +RF_timer > 0] ; OR +D/-R_timer > 0
  let os-patches patches with [-D_timer = 0 AND -DF_timer = 0 AND +RF_timer = 0] ; AND +D/-R_timer = 0
  
  let pi-corr-list calcOneCorrelation pi-patches
  set PI_B_variance item 0 pi-corr-list 
  set PI_C_variance item 1 pi-corr-list 
  set PI_BC_correlation item 2 pi-corr-list 
  
  let os-corr-list calcOneCorrelation os-patches
  set OS_B_variance item 0 os-corr-list 
  set OS_C_variance item 1 os-corr-list 
  set OS_BC_correlation item 2 os-corr-list
  
  set Forest_BC_correlation item 2 calcOneCorrelation patches with [land_use = 1 OR land_use = 2]
end

to-report calcOneCorrelation [curr-patches]
  let benefit-cost-correlation "N/A"
  let benefit-variance 0
  let cost-variance 0
  let cov-b&c 0
  if any? curr-patches
  [
    let mean-benefits ((sum [pot_FBPubl - pot_NBPubl] of curr-patches) / (count curr-patches))
    let mean-costs ((sum [pot_NBPriv - pot_FBPriv] of curr-patches) / (count curr-patches))
    ask curr-patches
    [
      set benefit-variance benefit-variance + (((pot_FBPubl - pot_NBPubl) - mean-benefits) ^ 2)
      set cost-variance cost-variance + (((pot_NBPriv - pot_FBPriv) - mean-costs) ^ 2)
      set cov-b&c cov-b&c + (((pot_FBPubl - pot_NBPubl) - mean-benefits) * ((pot_NBPriv - pot_FBPriv) - mean-costs))
    ]
    if sqrt(benefit-variance * cost-variance) != 0
    [set benefit-cost-correlation (cov-b&c / sqrt(benefit-variance * cost-variance))]
  ]
  report (list benefit-variance cost-variance benefit-cost-correlation)
end

to colorShading
  ;if color_shading_by != "no shading" ;land_use = 3
  ;[
    if color_shading_by = "net public forest benefits" [set pcolor (pcolor - 5 + (scale-color 5 (FBPubl_base - NBPubl_base) 1.5 -1.5))]
    if color_shading_by = "net private forest benefits" [set pcolor (pcolor - 5 + (scale-color 5 (FBPriv_base - NBPriv_base) 1.5 -1.5))]
  ;]
end

to markReforestation
  ask reforestation_marker_turtle [move-to myself stamp]
end

to setupPlots
  let c-patches patches
  ;if PlotOnlyForestPatches?
  ;[set c-patches patches with [land_use = 1 or land_use = 2]]
  if any? c-patches
  [
    clear-all-plots
    foreach (list "Public Private Benefit Plot: Deforestation" "Public Private Benefit Plot: Re-/Afforestation")
    [
      set-current-plot ?
      set-current-plot-pen "black"
      set-plot-pen-mode 0
      plot-pen-up
      plotxy 0 -1
      plot-pen-down
      plotxy 0 1
      plot-pen-up
      plotxy -1 0
      plot-pen-down
      plotxy 1 0
      plot-pen-up
      plotxy -1 1
      plot-pen-down
      plotxy 1 -1
    ]
    ask c-patches
    [

    ]
  ]
end

to plotIndividualDot
  let curr-x (pot_FBPriv - pot_NBPriv)
  let curr-y (pot_FBPubl - pot_NBPubl)
  set-current-plot "Public Private Benefit Plot: Re-/Afforestation"
  if land_use = 1 or (land_use = 2 AND +RF_timer <= 0)
  [
    set-current-plot "Public Private Benefit Plot: Deforestation"
    set curr-x (pot_NBPriv - pot_FBPriv)
    set curr-y (pot_NBPubl - pot_FBPubl)
  ] 
  set-current-plot-pen "dots" 
  set-plot-pen-color pcolor
  set-plot-pen-mode 2
  
  plot-pen-down plotxy curr-x curr-y plot-pen-up
end

to loadScenario 
  if scenario = "0. No Instruments" ; "No Instruments" OR scenario = "All Instruments Long"
  [
    set map_mode "X: NBPriv, Y: FBPriv"
    set color_shading_by "no shading"
    
    set NBPriv_is_homogenous? false
    set FBPriv_is_homogenous? false
    set NBPubl_is_homogenous? false
    set FBPubl_is_homogenous? false
    
    set FBPubl_corr_to_SoilQual 0
    set FBPubl_corr_to_NBPriv 0
    set FBPriv_corr_to_FBPubl 0
    set NBPubl_corr_to_NBPriv 0
    set reforest_value 1
    
    set NBPriv_policymaker_assumes "actual value"
    set FBPriv_policymaker_assumes "actual value"
    set NBPubl_policymaker_assumes "actual value"
    set FBPubl_policymaker_assumes "actual value"
    
    set FBPubl_scarcity_factor? false
    set NBPubl_scarcity_factor? false
    set NBPriv_scarcity_factor? false
    
    set -D_is "protected area"
    set -DF_is "compensation PES"
    set +RF_is "externality-value PES"
    set +D/-R_is "externality-value subsidy"
    
    set price_stages "[1 1 2 2 1 1]"
    let i 0 foreach ["-D_0" "-D_1" "-D_2" "-D_3" "-D_4" "-D_5"] [run word "set " word ? word " " (item i [0 0 0 0 0 0]) set i i + 1]
    set i 0 foreach ["-DF_0" "-DF_1" "-DF_2" "-DF_3" "-DF_4" "-DF_5"] [run word "set " word ? word " " (item i [0 0 0 0 0 0]) set i i + 1]
    set i 0 foreach ["+RF_0" "+RF_1" "+RF_2" "+RF_3" "+RF_4" "+RF_5"] [run word "set " word ? word " " (item i [0 0 0 0 0 0]) set i i + 1]
    set i 0 foreach ["+D/-R_0" "+D/-R_1" "+D/-R_2" "+D/-R_3" "+D/-R_4" "+D/-R_5"] [run word "set " word ? word " " (item i [0 0 0 0 0 0]) set i i + 1]   
  ]
  if scenario = "1. Pannell PPBF"
  [
    set map_mode "X: NBPriv, Y: FBPriv"
    set color_shading_by "no shading"
    
    set NBPriv_is_homogenous? false
    set FBPriv_is_homogenous? false
    set NBPubl_is_homogenous? false
    set FBPubl_is_homogenous? false
    
    set FBPubl_corr_to_SoilQual 0
    set FBPubl_corr_to_NBPriv 0
    set FBPriv_corr_to_FBPubl 0
    set NBPubl_corr_to_NBPriv 0
    set reforest_value 1
    
    set NBPriv_policymaker_assumes "actual value"
    set FBPriv_policymaker_assumes "actual value"
    set NBPubl_policymaker_assumes "actual value"
    set FBPubl_policymaker_assumes "actual value"
    
    set FBPubl_scarcity_factor? false
    set NBPubl_scarcity_factor? false
    set NBPriv_scarcity_factor? false
    
    set -D_is "protected area"
    set -DF_is "compensation PES"
    set +RF_is "externality-value PES"
    set +D/-R_is "externality-value subsidy"
    
    set price_stages "[1 1 2 2 1 1]"
    let i 0 foreach ["-D_0" "-D_1" "-D_2" "-D_3" "-D_4" "-D_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
    set i 0 foreach ["-DF_0" "-DF_1" "-DF_2" "-DF_3" "-DF_4" "-DF_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
    set i 0 foreach ["+RF_0" "+RF_1" "+RF_2" "+RF_3" "+RF_4" "+RF_5"] [run word "set " word ? word " " (item i [0 0 0 0 1 1]) set i i + 1]
    set i 0 foreach ["+D/-R_0" "+D/-R_1" "+D/-R_2" "+D/-R_3" "+D/-R_4" "+D/-R_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
  ]
  
  if scenario = "2a. High&Far Protected Areas" OR scenario = "2b. High&Far Protected Areas & PES"
  [
    set map_mode "X: NBPriv, Y: FBPriv"
    set color_shading_by "no shading"
    
    set NBPriv_is_homogenous? false
    set FBPriv_is_homogenous? true
    set NBPubl_is_homogenous? false
    set FBPubl_is_homogenous? false
    
    set FBPubl_corr_to_SoilQual 0
    set FBPubl_corr_to_NBPriv 0
    set FBPriv_corr_to_FBPubl 0
    set NBPubl_corr_to_NBPriv 0.5
    set reforest_value 0.75
    
    set NBPriv_policymaker_assumes "mean"
    set FBPriv_policymaker_assumes "actual value"
    set NBPubl_policymaker_assumes "actual value"
    set FBPubl_policymaker_assumes "mean"
    
    set FBPubl_scarcity_factor? false
    set NBPubl_scarcity_factor? false
    set NBPriv_scarcity_factor? false
    
    set -D_is "protected area"
    set -DF_is "compensation PES"
    set +RF_is "externality-value PES"
    set +D/-R_is "externality-value subsidy"
    
    set price_stages "[1 1 2 2 1 1]"
    let i 0 foreach ["-D_0" "-D_1" "-D_2" "-D_3" "-D_4" "-D_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 5]) set i i + 1]
    ifelse scenario = "2b. High&Far Protected Areas & PES"
    [set i 0 foreach ["-DF_0" "-DF_1" "-DF_2" "-DF_3" "-DF_4" "-DF_5"] [run word "set " word ? word " " (item i [0 1 1 1 0 0]) set i i + 1]]
    [set i 0 foreach ["-DF_0" "-DF_1" "-DF_2" "-DF_3" "-DF_4" "-DF_5"] [run word "set " word ? word " " (item i [0 0 0 0 0 0]) set i i + 1]]
    set i 0 foreach ["+RF_0" "+RF_1" "+RF_2" "+RF_3" "+RF_4" "+RF_5"] [run word "set " word ? word " " (item i [0 0 0 0 0 0]) set i i + 1]
    set i 0 foreach ["+D/-R_0" "+D/-R_1" "+D/-R_2" "+D/-R_3" "+D/-R_4" "+D/-R_5"] [run word "set " word ? word " " (item i [0 0 0 0 0 0]) set i i + 1]
  ]
  
  if scenario = "3a. Instrument Interaction: Baseline" OR scenario = "3b. Instrument Interaction: Treatment"
  [
    set map_mode "X: NBPriv, Y: FBPriv"
    set color_shading_by "no shading"    
    
    set NBPriv_is_homogenous? false
    set FBPriv_is_homogenous? false
    set NBPubl_is_homogenous? false
    set FBPubl_is_homogenous? false
    
    set FBPubl_corr_to_SoilQual 0
    set FBPubl_corr_to_NBPriv 0
    set FBPriv_corr_to_FBPubl 0
    set NBPubl_corr_to_NBPriv 0
    set reforest_value 1
    
    set NBPriv_policymaker_assumes "actual value"
    set FBPriv_policymaker_assumes "actual value"
    set NBPubl_policymaker_assumes "actual value"
    set FBPubl_policymaker_assumes "actual value"
    
    set FBPubl_scarcity_factor? true
    set NBPubl_scarcity_factor? true
    set NBPriv_scarcity_factor? false
    
    set -D_is "protected area"
    set -DF_is "compensation PES"
    set +RF_is "externality-value PES"
    set +D/-R_is "externality-value subsidy"
    
    set price_stages "[1 1 2 2 1 1]"
    let i 0 foreach ["-D_0" "-D_1" "-D_2" "-D_3" "-D_4" "-D_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
    set i 0 foreach ["-DF_0" "-DF_1" "-DF_2" "-DF_3" "-DF_4" "-DF_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
    set i 0 foreach ["+RF_0" "+RF_1" "+RF_2" "+RF_3" "+RF_4" "+RF_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
    ifelse scenario = "3a. Instrument Interaction: Baseline"
    [set i 0 foreach ["+D/-R_0" "+D/-R_1" "+D/-R_2" "+D/-R_3" "+D/-R_4" "+D/-R_5"] [run word "set " word ? word " " (item i [0 0 0 0 0 0]) set i i + 1]]
    [set i 0 foreach ["+D/-R_0" "+D/-R_1" "+D/-R_2" "+D/-R_3" "+D/-R_4" "+D/-R_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]]
  ]
  if scenario = "4a. Ignorance: Baseline" OR scenario = "4b. Ignorance: Negative Effect"
    OR scenario = "4c. Ignorance: Ignorance is Bliss"
  [
    set map_mode "X: NBPriv, Y: FBPriv"
    set color_shading_by "no shading"
    
    set NBPriv_is_homogenous? false
    set FBPriv_is_homogenous? false
    set NBPubl_is_homogenous? false
    set FBPubl_is_homogenous? false
    
    set FBPubl_corr_to_SoilQual 0
    set FBPubl_corr_to_NBPriv 1
    set FBPriv_corr_to_FBPubl 0
    set NBPubl_corr_to_NBPriv 0
    set reforest_value 0.75
    
    set NBPriv_policymaker_assumes "actual value"
    if scenario = "4c. Ignorance: Ignorance is Bliss"
    [set NBPriv_policymaker_assumes "mean"]
    set FBPriv_policymaker_assumes "actual value"
    set NBPubl_policymaker_assumes "actual value"
    set FBPubl_policymaker_assumes "actual value"
    if scenario = "4b. Ignorance: Negative Effect"
    [set FBPubl_policymaker_assumes "mean"]
    
    set FBPubl_scarcity_factor? false
    set NBPubl_scarcity_factor? false
    set NBPriv_scarcity_factor? false
    
    set -D_is "protected area"
    set -DF_is "externality-value PES"
    set +RF_is "externality-value PES"
    set +D/-R_is "externality-value subsidy"
    
    set price_stages "[1 1 2 2 1 1]"
    let i 0 foreach ["-D_0" "-D_1" "-D_2" "-D_3" "-D_4" "-D_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
    set i 0 foreach ["-DF_0" "-DF_1" "-DF_2" "-DF_3" "-DF_4" "-DF_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
    set i 0 foreach ["+RF_0" "+RF_1" "+RF_2" "+RF_3" "+RF_4" "+RF_5"] [run word "set " word ? word " " (item i [0 0 0 0 1 1]) set i i + 1]
    set i 0 foreach ["+D/-R_0" "+D/-R_1" "+D/-R_2" "+D/-R_3" "+D/-R_4" "+D/-R_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
  ]
  if scenario = "5a. SQ-Dist Map: Extremistan 1" OR scenario = "5b. SQ-Dist Map: Extremistan 2"
  [
    set map_mode "X: Soil Quality, Y: Market Distance"
    set color_shading_by "no shading"
    
    set NBPriv_is_homogenous? false
    ifelse scenario = "5a. SQ-Dist Map: Extremistan 1"
    [set FBPriv_is_homogenous? true]
    [set FBPriv_is_homogenous? false]
    set NBPubl_is_homogenous? false
    set FBPubl_is_homogenous? false
    
    ifelse scenario = "5a. SQ-Dist Map: Extremistan 1"
    [
      set FBPubl_corr_to_SoilQual 1
      set FBPubl_corr_to_NBPriv 0
      set FBPriv_corr_to_FBPubl 0
      set NBPubl_corr_to_NBPriv -1
      set reforest_value 1
    ]
    [
      set FBPubl_corr_to_SoilQual 1
      set FBPubl_corr_to_NBPriv 0
      set FBPriv_corr_to_FBPubl 0.5
      set NBPubl_corr_to_NBPriv 1
      set reforest_value 0.75
    ]
    
    ifelse scenario = "5a. SQ-Dist Map: Extremistan 1"
    [
      set NBPriv_policymaker_assumes "mean"
      set FBPriv_policymaker_assumes "actual value"
      set NBPubl_policymaker_assumes "mean"
      set FBPubl_policymaker_assumes "actual value"
    ]
    [
      set NBPriv_policymaker_assumes "actual value"
      set FBPriv_policymaker_assumes "mean"
      set NBPubl_policymaker_assumes "mean"
      set FBPubl_policymaker_assumes "actual value"
    ]
    
    ifelse scenario = "5a. SQ-Dist Map: Extremistan 1"
    [
      set FBPubl_scarcity_factor? false
      set NBPubl_scarcity_factor? false
      set NBPriv_scarcity_factor? false
    ]
    [
      set FBPubl_scarcity_factor? true
      set NBPubl_scarcity_factor? true
      set NBPriv_scarcity_factor? true
    ]
    
    set -D_is "protected area"
    set -DF_is "compensation PES"
    set +RF_is "externality-value PES"
    set +D/-R_is "externality-value subsidy"
    
    set price_stages "[1 1 2 2 1 1]"
    let i 0 foreach ["-D_0" "-D_1" "-D_2" "-D_3" "-D_4" "-D_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
    set i 0 foreach ["-DF_0" "-DF_1" "-DF_2" "-DF_3" "-DF_4" "-DF_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
    set i 0 foreach ["+RF_0" "+RF_1" "+RF_2" "+RF_3" "+RF_4" "+RF_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
    set i 0 foreach ["+D/-R_0" "+D/-R_1" "+D/-R_2" "+D/-R_3" "+D/-R_4" "+D/-R_5"] [run word "set " word ? word " " (item i [0 1 1 1 1 1]) set i i + 1]
    
    set i 0 foreach ["-D_0" "-D_1" "-D_2" "-D_3" "-D_4" "-D_5"] [run word "set " word ? word " " (item i [0 5 5 5 5 5]) set i i + 1]
    set i 0 foreach ["-DF_0" "-DF_1" "-DF_2" "-DF_3" "-DF_4" "-DF_5"] [run word "set " word ? word " " (item i [0 5 5 5 5 5]) set i i + 1]
    set i 0 foreach ["+RF_0" "+RF_1" "+RF_2" "+RF_3" "+RF_4" "+RF_5"] [run word "set " word ? word " " (item i [0 5 5 5 5 5]) set i i + 1]
    set i 0 foreach ["+D/-R_0" "+D/-R_1" "+D/-R_2" "+D/-R_3" "+D/-R_4" "+D/-R_5"] [run word "set " word ? word " " (item i [0 5 5 5 5 5]) set i i + 1]    
  ]
  setup
end