Skip to content
Snippets Groups Projects
Commit aefb2200 authored by jburns10's avatar jburns10
Browse files

Interpolate timber intensity limits

parent b7be932d
No related branches found
No related tags found
No related merge requests found
...@@ -246,10 +246,10 @@ public class GamsLocationOptimiser { ...@@ -246,10 +246,10 @@ public class GamsLocationOptimiser {
double irrigConstraintFactor; double irrigConstraintFactor;
switch (farmingType) { switch (farmingType) {
case CONVENTIONAL: case CONVENTIONAL:
irrigConstraintFactor = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_IRRIGATION_CONSTRAINT_FACTOR); irrigConstraintFactor = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_IRRIGATION_CONSTRAINT_FACTOR, false);
break; break;
case RESTRICTED: case RESTRICTED:
irrigConstraintFactor = getNegativeExponentialProgression(ModelConfig.PROTECTED_IRRIGATION_CONSTRAINT_FACTOR); irrigConstraintFactor = getNegativeExponentialProgression(ModelConfig.PROTECTED_IRRIGATION_CONSTRAINT_FACTOR, false);
break; break;
default: default:
irrigConstraintFactor = 1.0; irrigConstraintFactor = 1.0;
...@@ -402,10 +402,10 @@ public class GamsLocationOptimiser { ...@@ -402,10 +402,10 @@ public class GamsLocationOptimiser {
double meatEff = ModelConfig.getAdjParam("MEAT_EFFICIENCY"); double meatEff = ModelConfig.getAdjParam("MEAT_EFFICIENCY");
double fertCost = ModelConfig.getAdjParam("FERTILISER_COST_PER_T"); double fertCost = ModelConfig.getAdjParam("FERTILISER_COST_PER_T");
double otherIntCost = ModelConfig.getAdjParam("OTHER_INTENSITY_COST"); double otherIntCost = ModelConfig.getAdjParam("OTHER_INTENSITY_COST");
double fertLimRestr = getNegativeExponentialProgression(ModelConfig.PROTECTED_CROPLAND_FERTILISER_LIMIT); double fertLimRestr = getNegativeExponentialProgression(ModelConfig.PROTECTED_CROPLAND_FERTILISER_LIMIT, false);
double otherLimRestr = getNegativeExponentialProgression(ModelConfig.PROTECTED_CROPLAND_OTHER_LIMIT); double otherLimRestr = getNegativeExponentialProgression(ModelConfig.PROTECTED_CROPLAND_OTHER_LIMIT, false);
double fertLimConv = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_CROPLAND_FERTILISER_LIMIT); double fertLimConv = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_CROPLAND_FERTILISER_LIMIT, false);
double otherLimConv = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_CROPLAND_OTHER_LIMIT); double otherLimConv = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_CROPLAND_OTHER_LIMIT, false);
LogWriter.print("\n", 3); LogWriter.print("\n", 3);
...@@ -471,9 +471,12 @@ public class GamsLocationOptimiser { ...@@ -471,9 +471,12 @@ public class GamsLocationOptimiser {
// Prices // Prices
setGamsParamValue(importPriceP.addRecord("wood"), countryInput.getWoodPrice().getImportPrice() , -1); setGamsParamValue(importPriceP.addRecord("wood"), countryInput.getWoodPrice().getImportPrice() , -1);
setGamsParamValue(exportPriceP.addRecord("wood"), countryInput.getWoodPrice().getExportPrice(), -1); setGamsParamValue(exportPriceP.addRecord("wood"), countryInput.getWoodPrice().getExportPrice(), -1);
addScalar(inDB, "timberLimProtected", ModelConfig.PROTECTED_TIMBER_INTENSITY_LIMIT, -1); double timberLimPro = getNegativeExponentialProgression(ModelConfig.PROTECTED_TIMBER_INTENSITY_LIMIT, true);
addScalar(inDB, "timberLimUnprotected", ModelConfig.UNPROTECTED_TIMBER_INTENSITY_LIMIT, -1); double timberLimUnpro = getNegativeExponentialProgression(ModelConfig.UNPROTECTED_TIMBER_INTENSITY_LIMIT, true);
addScalar(inDB, "timberLimProtected", timberLimPro, -1);
addScalar(inDB, "timberLimUnprotected", timberLimUnpro, -1);
addScalar(inDB, "forestManagementCost", addScalar(inDB, "forestManagementCost",
ModelConfig.getAdjParam("FOREST_MANAGEMENT_COST") * calibrationItem.getForestryCostFactor(), -1); ModelConfig.getAdjParam("FOREST_MANAGEMENT_COST") * calibrationItem.getForestryCostFactor(), -1);
...@@ -939,19 +942,20 @@ public class GamsLocationOptimiser { ...@@ -939,19 +942,20 @@ public class GamsLocationOptimiser {
return linearProgression; return linearProgression;
} }
private double getNegativeExponentialProgression(double constraintFactor) { private double getNegativeExponentialProgression(double constraintFactor, boolean isForestryLimit) {
int currentYear = inputData.getTimestep().getYear(); int currentYear = inputData.getTimestep().getYear();
int startYear = ModelConfig.INTENSITY_LIMIT_START_YEAR; int startYear = ModelConfig.INTENSITY_LIMIT_START_YEAR;
int endYear = ModelConfig.INTENSITY_LIMIT_END_YEAR; int endYear = ModelConfig.INTENSITY_LIMIT_END_YEAR;
double linearProgressionAdjustmentRatio = (double)(currentYear - startYear) / (endYear - startYear); 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); Math.exp(-decayFactor * linearProgressionAdjustmentRatio);
// Bound between 0 and 1 // Bound between constraintFactor and startValue
exponentialProgression = Math.min(exponentialProgression, 1); exponentialProgression = Math.min(exponentialProgression, startValue);
exponentialProgression = Math.max(exponentialProgression, constraintFactor); exponentialProgression = Math.max(exponentialProgression, constraintFactor);
return exponentialProgression; return exponentialProgression;
......
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