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

Remove cropAdj

parent 479ee663
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
PARAMETER irrigCost(location) irrigation cost in energy per 1000 Mlitre or Mha for each litre per m2; PARAMETER irrigCost(location) irrigation cost in energy per 1000 Mlitre or Mha for each litre per m2;
PARAMETER irrigMaxRate(crop, location) max water application rate irrigation in litre per m2; PARAMETER irrigMaxRate(crop, location) max water application rate irrigation in litre per m2;
PARAMETER irrigConstraint(location) max water available for irrigation in litre per m2; PARAMETER irrigConstraint(location) max water available for irrigation in litre per m2;
PARAMETER cropAdj(crop) this is the fudge factor that allows the model to fit the observed data
SCALAR meatEfficency efficiency of converting feed and pasture into animal products; SCALAR meatEfficency efficiency of converting feed and pasture into animal products;
SCALAR landChangeEnergy energy required to add ha of agricultural land; SCALAR landChangeEnergy energy required to add ha of agricultural land;
...@@ -35,13 +34,14 @@ ...@@ -35,13 +34,14 @@
SCALAR otherIParam yield response to other intensity; SCALAR otherIParam yield response to other intensity;
SCALAR otherICost cost of other intensity; SCALAR otherICost cost of other intensity;
SCALAR unhandledCropArea includes fruit veg forage crops set aside and failed crop; SCALAR unhandledCropArea includes fruit veg forage crops set aside and failed crop;
SCALAR domesticPriceMarkup factor price increased from cost of production;
*$gdxin "/Users/peteralexander/Documents/R_Workspace/temp/GamsTest/_gams_java_1091455539.gdx" *$gdxin "/Users/peteralexander/Documents/R_Workspace/temp/GamsTest/_gams_java_1091455539.gdx"
$gdxin %gdxincname% $gdxin %gdxincname%
$load location, suitableLandArea, previousArea, demand, landChangeEnergy $load location, suitableLandArea, previousArea, demand, landChangeEnergy
$load yieldNone, yieldFertOnly, yieldIrrigOnly, yieldBoth $load yieldNone, yieldFertOnly, yieldIrrigOnly, yieldBoth
$load fertParam, irrigParam, otherIParam, worldExportPrices, worldImportPrices, maxNetImport, minNetImport, unhandledCropArea $load fertParam, irrigParam, otherIParam, worldExportPrices, worldImportPrices, maxNetImport, minNetImport, unhandledCropArea
$load meatEfficency, minFeedRate, otherICost, irrigCost, irrigMaxRate, irrigConstraint, cropAdj, fertiliserUnitCost $load meatEfficency, minFeedRate, otherICost, irrigCost, irrigMaxRate, irrigConstraint, fertiliserUnitCost, domesticPriceMarkup
$gdxin $gdxin
SCALAR delta use to smooth power function see 7.5 www.gams.com dd docs solversconopt.pdf / 0.00000000001 / SCALAR delta use to smooth power function see 7.5 www.gams.com dd docs solversconopt.pdf / 0.00000000001 /
...@@ -133,7 +133,7 @@ $gdxin ...@@ -133,7 +133,7 @@ $gdxin
(yieldBoth(crop, location) + yieldNone(crop, location) - yieldFertOnly(crop, location) - yieldIrrigOnly(crop, location)) * (yieldBoth(crop, location) + yieldNone(crop, location) - yieldFertOnly(crop, location) - yieldIrrigOnly(crop, location)) *
(1 - exp(-fertParam(crop, location)*fertI(crop, location))) * (1 - exp(-irrigParam(crop, location)*irrigI(crop, location))) (1 - exp(-fertParam(crop, location)*fertI(crop, location))) * (1 - exp(-irrigParam(crop, location)*irrigI(crop, location)))
) * cropAdj(crop) * (1 - exp(-otherIntensity(crop, location)*otherIParam)); ) * (1 - exp(-otherIntensity(crop, location)*otherIParam));
NET_SUPPLY_EQ(crop) .. net_supply(crop) =E= (sum(location, area(crop, location) * yield(crop, location)) - feedAmount(crop)) / cropDM(crop) + importAmount(crop) - exportAmount(crop); NET_SUPPLY_EQ(crop) .. net_supply(crop) =E= (sum(location, area(crop, location) * yield(crop, location)) - feedAmount(crop)) / cropDM(crop) + importAmount(crop) - exportAmount(crop);
...@@ -171,14 +171,15 @@ $gdxin ...@@ -171,14 +171,15 @@ $gdxin
ENERGY_EQ .. energy =E= ENERGY_EQ .. energy =E=
( (
SUM((crop, location), area(crop, location) * unitEnergy(crop, location)) + ( SUM((crop, location), area(crop, location) * unitEnergy(crop, location)) +
sum(location, sum(location,
agriLandExpansion(location) + agriLandExpansion(location) +
0.5 * cropIncrease(location) + 0.5 * cropIncrease(location) +
0.5 * cropDecrease(location) + 0.5 * cropDecrease(location) +
0.5 * pastureIncrease(location) + 0.5 * pastureIncrease(location) +
0.5 * pastureDecrease(location) 0.5 * pastureDecrease(location)
) * landChangeEnergy + ) * landChangeEnergy
) * domesticPriceMarkup +
sum(import_crop, importAmount(import_crop) * worldImportPrices(import_crop) - exportAmount(import_crop) * worldExportPrices(import_crop)) sum(import_crop, importAmount(import_crop) * worldImportPrices(import_crop) - exportAmount(import_crop) * worldExportPrices(import_crop))
) / 1000000; ) / 1000000;
......
...@@ -157,9 +157,9 @@ public class ModelConfig { ...@@ -157,9 +157,9 @@ public class ModelConfig {
public static final double FERTILISER_COST_PER_T = getDoubleProperty("FERTILISER_COST_PER_T", 0.87 * 1.4 * 2); // £900/t N * 1.4$/£ * 2NPK/N public static final double FERTILISER_COST_PER_T = getDoubleProperty("FERTILISER_COST_PER_T", 0.87 * 1.4 * 2); // £900/t N * 1.4$/£ * 2NPK/N
public static final double FERTILISER_MAX_COST = FERTILISER_COST_PER_T * MAX_FERT_AMOUNT/1000; public static final double FERTILISER_MAX_COST = FERTILISER_COST_PER_T * MAX_FERT_AMOUNT/1000;
public static final double DOMESTIC_LOSSES = getDoubleProperty("DOMESTIC_LOSSES", 0.1); // in international trade public static final double DOMESTIC_PRICE_MARKUP = getDoubleProperty("DOMESTIC_PRICE_MARKUP", 1.4);
public static final double TRANSPORT_LOSSES = getDoubleProperty("TRANSPORT_LOSSES", 0.15); // in international trade public static final double TRANSPORT_LOSSES = getDoubleProperty("TRANSPORT_LOSSES", 0.1); // in international trade
public static final double TRADE_BARRIER_FACTOR = getDoubleProperty("TRADE_BARRIER_FACTOR", 1.5); // price factor in international trade, transport cost and real trade barriers public static final double TRADE_BARRIER_FACTOR = getDoubleProperty("TRADE_BARRIER_FACTOR", 1.4); // price factor in international trade, transport cost and real trade barriers
public static final int NUM_CEREAL_CATEGORIES = getIntProperty("NUM_CEREAL_CATEGORIES", 5); public static final int NUM_CEREAL_CATEGORIES = getIntProperty("NUM_CEREAL_CATEGORIES", 5);
public static final int NUM_PASTURE_CATEGORIES = getIntProperty("NUM_PASTURE_CATEGORIES", 1); public static final int NUM_PASTURE_CATEGORIES = getIntProperty("NUM_PASTURE_CATEGORIES", 1);
......
...@@ -16,7 +16,7 @@ public class GlobalPrice { ...@@ -16,7 +16,7 @@ public class GlobalPrice {
} }
public static GlobalPrice createInitial(double exportPrice) { public static GlobalPrice createInitial(double exportPrice) {
return new GlobalPrice(exportPrice * ModelConfig.TRADE_BARRIER_FACTOR / (1-ModelConfig.TRANSPORT_LOSSES), exportPrice, Double.NaN, Double.NaN); return new GlobalPrice(exportPrice, exportPrice * (1-ModelConfig.TRANSPORT_LOSSES) / ModelConfig.TRADE_BARRIER_FACTOR, Double.NaN, Double.NaN);
} }
public double getImportPrice() { public double getImportPrice() {
......
...@@ -195,9 +195,7 @@ public class GamsLocationOptimiser { ...@@ -195,9 +195,7 @@ public class GamsLocationOptimiser {
addScalar(inDB, "landChangeEnergy", countryInput.getLandChangeEnergy()); addScalar(inDB, "landChangeEnergy", countryInput.getLandChangeEnergy());
addScalar(inDB, "minFeedRate", countryInput.getMinFeedRate()); addScalar(inDB, "minFeedRate", countryInput.getMinFeedRate());
addScalar(inDB, "unhandledCropArea", ModelConfig.UNHANDLED_CROP_AREA); addScalar(inDB, "unhandledCropArea", ModelConfig.UNHANDLED_CROP_AREA);
addScalar(inDB, "domesticPriceMarkup", ModelConfig.DOMESTIC_PRICE_MARKUP);
if (DEBUG) LogWriter.println("\ncropAdj");
addItemMapParm(inDB.addParameter("cropAdj", 1), countryInput.getCropAdjustments(), DEBUG);
} }
private void addScalar(GAMSDatabase gamsDb, String recordName, double val) { private void addScalar(GAMSDatabase gamsDb, String recordName, double val) {
...@@ -230,7 +228,7 @@ public class GamsLocationOptimiser { ...@@ -230,7 +228,7 @@ public class GamsLocationOptimiser {
GAMSParameter parmNetImports = outDB.getParameter("netImportAmount"); GAMSParameter parmNetImports = outDB.getParameter("netImportAmount");
GAMSVariable varYields = outDB.getVariable("yield"); GAMSVariable varYields = outDB.getVariable("yield");
GAMSVariable varUnitEnergies = outDB.getVariable("unitEnergy"); GAMSVariable varUnitEnergies = outDB.getVariable("unitEnergy");
GAMSParameter parmCropAdj = outDB.getParameter("cropAdj"); // GAMSParameter parmCropAdj = outDB.getParameter("cropAdj");
GAMSParameter parmProd = outDB.getParameter("totalProd"); GAMSParameter parmProd = outDB.getParameter("totalProd");
GAMSParameter parmProdCost = outDB.getParameter("totalProdCost"); GAMSParameter parmProdCost = outDB.getParameter("totalProdCost");
GAMSParameter parmCroplandArea = outDB.getParameter("totalCropland"); GAMSParameter parmCroplandArea = outDB.getParameter("totalCropland");
...@@ -264,13 +262,13 @@ public class GamsLocationOptimiser { ...@@ -264,13 +262,13 @@ public class GamsLocationOptimiser {
if (!cropUsageData.containsKey(cropType)) { // then we must not have seen this crop type before, so need to do all non location specific stuff if (!cropUsageData.containsKey(cropType)) { // then we must not have seen this crop type before, so need to do all non location specific stuff
feedAmount = varFeedAmount.findRecord(itemName).getLevel(); feedAmount = varFeedAmount.findRecord(itemName).getLevel();
netImport = cropType.isImportedCrop() ? getParmValue(parmNetImports, itemName) : 0; netImport = cropType.isImportedCrop() ? getParmValue(parmNetImports, itemName) : 0;
cropAdj = getParmValue(parmCropAdj, itemName); // cropAdj = getParmValue(parmCropAdj, itemName);
prod = getParmValue(parmProd, itemName); prod = getParmValue(parmProd, itemName);
prodCost = getParmValue(parmProdCost, itemName); prodCost = getParmValue(parmProdCost, itemName);
cropUsageData.put(cropType, new CropUsageData(feedAmount, netImport, prod, prodCost)); cropUsageData.put(cropType, new CropUsageData(feedAmount, netImport, prod, prodCost));
cropAdjs.put(cropType, cropAdj); // cropAdjs.put(cropType, cropAdj);
if (DEBUG) LogWriter.println(String.format("\n%s:\tfeedAmount= %.1f,\tnetImports= %.3f,\tprod= %.3f,\tprodCost= %.3f,\tcropAdj= %.3f", itemName, feedAmount, netImport, prod, prodCost, cropAdj)); if (DEBUG) LogWriter.println(String.format("\n%s:\tfeedAmount= %.1f,\tnetImports= %.3f,\tprod= %.3f,\tprodCost= %.3f,\tcropAdj= %.3f", itemName, feedAmount, netImport, prod, prodCost, Double.NaN));
} }
LandUseItem landUseItem = landUses.lazyGet(locId); LandUseItem landUseItem = landUses.lazyGet(locId);
......
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