diff --git a/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java b/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java index 4ec7fa77b190db4ca30dd611a50aca7f96d57fe2..b023841c8411f96b9dc8c256617522e32b00860d 100644 --- a/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java +++ b/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java @@ -246,10 +246,10 @@ public class GamsLocationOptimiser { double irrigConstraintFactor; switch (farmingType) { case CONVENTIONAL: - irrigConstraintFactor = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_IRRIGATION_CONSTRAINT_FACTOR); + irrigConstraintFactor = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_IRRIGATION_CONSTRAINT_FACTOR, false); break; case RESTRICTED: - irrigConstraintFactor = getNegativeExponentialProgression(ModelConfig.PROTECTED_IRRIGATION_CONSTRAINT_FACTOR); + irrigConstraintFactor = getNegativeExponentialProgression(ModelConfig.PROTECTED_IRRIGATION_CONSTRAINT_FACTOR, false); break; default: irrigConstraintFactor = 1.0; @@ -402,10 +402,10 @@ public class GamsLocationOptimiser { double meatEff = ModelConfig.getAdjParam("MEAT_EFFICIENCY"); double fertCost = ModelConfig.getAdjParam("FERTILISER_COST_PER_T"); double otherIntCost = ModelConfig.getAdjParam("OTHER_INTENSITY_COST"); - double fertLimRestr = getNegativeExponentialProgression(ModelConfig.PROTECTED_CROPLAND_FERTILISER_LIMIT); - double otherLimRestr = getNegativeExponentialProgression(ModelConfig.PROTECTED_CROPLAND_OTHER_LIMIT); - double fertLimConv = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_CROPLAND_FERTILISER_LIMIT); - double otherLimConv = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_CROPLAND_OTHER_LIMIT); + double fertLimRestr = getNegativeExponentialProgression(ModelConfig.PROTECTED_CROPLAND_FERTILISER_LIMIT, false); + double otherLimRestr = getNegativeExponentialProgression(ModelConfig.PROTECTED_CROPLAND_OTHER_LIMIT, false); + double fertLimConv = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_CROPLAND_FERTILISER_LIMIT, false); + double otherLimConv = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_CROPLAND_OTHER_LIMIT, false); LogWriter.print("\n", 3); @@ -471,9 +471,12 @@ public class GamsLocationOptimiser { // Prices setGamsParamValue(importPriceP.addRecord("wood"), countryInput.getWoodPrice().getImportPrice() , -1); setGamsParamValue(exportPriceP.addRecord("wood"), countryInput.getWoodPrice().getExportPrice(), -1); - - addScalar(inDB, "timberLimProtected", ModelConfig.PROTECTED_TIMBER_INTENSITY_LIMIT, -1); - addScalar(inDB, "timberLimUnprotected", ModelConfig.UNPROTECTED_TIMBER_INTENSITY_LIMIT, -1); + + double timberLimPro = getNegativeExponentialProgression(ModelConfig.PROTECTED_TIMBER_INTENSITY_LIMIT, true); + double timberLimUnpro = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_TIMBER_INTENSITY_LIMIT, true); + + addScalar(inDB, "timberLimProtected", timberLimPro, -1); + addScalar(inDB, "timberLimUnprotected", timberLimUnpro, -1); addScalar(inDB, "forestManagementCost", ModelConfig.getAdjParam("FOREST_MANAGEMENT_COST") * calibrationItem.getForestryCostFactor(), -1); @@ -939,19 +942,20 @@ public class GamsLocationOptimiser { return linearProgression; } - private double getNegativeExponentialProgression(double constraintFactor) { + private double getNegativeExponentialProgression(double constraintFactor, boolean isForestryLimit) { int currentYear = inputData.getTimestep().getYear(); int startYear = ModelConfig.INTENSITY_LIMIT_START_YEAR; int endYear = ModelConfig.INTENSITY_LIMIT_END_YEAR; double linearProgressionAdjustmentRatio = (double)(currentYear - startYear) / (endYear - startYear); - int decayFactor = ModelConfig.INTENSITY_LIMIT_DECAY_FACTOR; + double startValue = isForestryLimit ? 0.1 : 1.0; + int decayFactor = ModelConfig.INTENSITY_LIMIT_DECAY_FACTOR; - double exponentialProgression = constraintFactor + (1 - constraintFactor) * + double exponentialProgression = constraintFactor + (startValue - constraintFactor) * Math.exp(-decayFactor * linearProgressionAdjustmentRatio); - // Bound between 0 and 1 - exponentialProgression = Math.min(exponentialProgression, 1); + // Bound between constraintFactor and startValue + exponentialProgression = Math.min(exponentialProgression, startValue); exponentialProgression = Math.max(exponentialProgression, constraintFactor); return exponentialProgression;