Skip to content
Snippets Groups Projects
Commit 1e30e1b4 authored by Peter Alexander's avatar Peter Alexander
Browse files

Set max irrig amount for setaside to get zero intensity for that crop

parent f5dec23a
No related branches found
No related tags found
No related merge requests found
...@@ -204,8 +204,14 @@ public class GamsLocationOptimiser { ...@@ -204,8 +204,14 @@ public class GamsLocationOptimiser {
IrrigationItem irrigationItem = irrigationData.get(locationId); IrrigationItem irrigationItem = irrigationData.get(locationId);
for (CropType crop : CropType.getNonMeatTypes()) { for (CropType crop : CropType.getNonMeatTypes()) {
if (crop.equals(CropType.SETASIDE)) Vector<String> v = new Vector<String>();
v.add(crop.getGamsName());
v.add(locString);
if (crop.equals(CropType.SETASIDE)) {
setGamsParamValue(irrigMaxP.addRecord(v), 1000, 3); // need to set this to any positive value to give an incentive not to irrigate setaside
continue; continue;
}
double maxIrrig = irrigationItem.getMaxIrrigAmount(crop); double maxIrrig = irrigationItem.getMaxIrrigAmount(crop);
...@@ -213,10 +219,6 @@ public class GamsLocationOptimiser { ...@@ -213,10 +219,6 @@ public class GamsLocationOptimiser {
locationId, crop.getGamsName(), yresp.getYieldNone(crop), yresp.getYieldFertOnly(crop), yresp.getYieldIrrigOnly(crop), yresp.getYieldMax(crop), locationId, crop.getGamsName(), yresp.getYieldNone(crop), yresp.getYieldFertOnly(crop), yresp.getYieldIrrigOnly(crop), yresp.getYieldMax(crop),
yresp.getFertParam(crop), yresp.getIrrigParam(crop), maxIrrig)); yresp.getFertParam(crop), yresp.getIrrigParam(crop), maxIrrig));
Vector<String> v = new Vector<String>();
v.add(crop.getGamsName());
v.add(locString);
setGamsParamValue(yNoneP.addRecord(v), yresp.getYieldNone(crop), 4); setGamsParamValue(yNoneP.addRecord(v), yresp.getYieldNone(crop), 4);
setGamsParamValue(y_fert.addRecord(v), yresp.getYieldFertOnly(crop), 4); setGamsParamValue(y_fert.addRecord(v), yresp.getYieldFertOnly(crop), 4);
setGamsParamValue(y_irrig.addRecord(v), yresp.getYieldIrrigOnly(crop), 4); setGamsParamValue(y_irrig.addRecord(v), yresp.getYieldIrrigOnly(crop), 4);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment