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

Remove trader barrier

parent 9317e5dd
No related branches found
No related tags found
No related merge requests found
......@@ -20,12 +20,11 @@
SCALAR meatEfficency efficiency of converting feed and pasture into animal products;
SCALAR maxLandUseChange max rate of land use change;
SCALAR tradeBarrier trade barrier which adjust energy cost of imports;
SCALAR landChangeEnergy energy required to add ha of agricultural land;
SCALAR minFeedRate minimum rate of feed for producing animal products;
$gdxin %gdxincname%
$load location, suitableLandArea, previous_area, demand, yieldNone, yieldFertOnly, yieldIrrigOnly, yieldBoth, fertParam, irrigParam, worldInputEnergy, maxNetImport, minNetImport, meatEfficency, maxLandUseChange, tradeBarrier, landChangeEnergy, minFeedRate
$load location, suitableLandArea, previous_area, demand, yieldNone, yieldFertOnly, yieldIrrigOnly, yieldBoth, fertParam, irrigParam, worldInputEnergy, maxNetImport, minNetImport, meatEfficency, maxLandUseChangef, landChangeEnergy, minFeedRate
$gdxin
SCALAR delta use to smooth power function see 7.5 www.gams.com dd docs solversconopt.pdf / 0.00000000001 /
......@@ -120,7 +119,7 @@ $gdxin
ENERGY_EQ .. energy =E= (SUM((crop, location), area(crop, location) * unitEnergy(crop, location))
+ sum(location, sum(crop, area(crop, location)) - sum(crop, previous_area(crop, location)) * landChangeEnergy)
+ sum(crop, (netImportAmount(crop) * tradeBarrier) * worldInputEnergy(crop))) / 1000000;
+ sum(crop, (netImportAmount(crop)) * worldInputEnergy(crop))) / 1000000;
MODEL LAND_USE /ALL/ ;
SOLVE LAND_USE USING NLP MINIMIZING energy;
......
......@@ -66,6 +66,8 @@ public class ModelMain {
CropToDoubleMap totalArea = new CropToDoubleMap();
CropToDoubleMap totalWorldInputEnergy = new CropToDoubleMap();
// CropToDoubleMap totalImportCommodities = new CropToDoubleMap();
// CropToDoubleMap totalExportCommodities = new CropToDoubleMap();
for (CountryAgent ca : countryAgents) {
LogWriter.println("Country " + ca.getCountry());
......@@ -91,6 +93,16 @@ public class ModelMain {
totalWorldInputEnergy.incrementValue(crop, area * intensity.getUnitEnergy());
}
}
/* for (CropType crop : CropType.values()) {
CommodityData cd = result.getCommoditiesData().get(crop);
double netImport = cd.getNetImports();
if (netImport > 0)
totalImportCommodities.incrementValue(crop, netImport);
else
totalExportCommodities.incrementValue(crop, -netImport);
} */
}
prevWorldInputEnergy = totalWorldInputEnergy.divideBy(totalArea);
......
......@@ -105,6 +105,8 @@ public class CountryAgent {
Map<CropType, Double> maxNetImport = new HashMap<CropType, Double>();
Map<CropType, Double> minNetImport = new HashMap<CropType, Double>();
for (Map.Entry<CropType, CommodityData> entry : prevCommoditiesData.entrySet()) {
double largerOfProductionOrSupply; // this is what might be better to use than the netImport amount
maxNetImport.put(entry.getKey(), entry.getValue().getNetImports() * (1 + allowedImportChange));
minNetImport.put(entry.getKey(), entry.getValue().getNetImports() * (1 - allowedImportChange));
}
......
......@@ -57,10 +57,6 @@ public class GamsCountryInput {
return 0.05;
}
public double getTradeBarrier() {
return 4;
}
public double getLandChangeEnergy() {
return 0.1;
}
......
......@@ -134,7 +134,6 @@ public class GamsLocationOptimiser {
addScalar(inDB.addParameter("meatEfficency", 0), inputData.getCountryInput().getMeatEfficiency());
addScalar(inDB.addParameter("maxLandUseChange", 0), inputData.getCountryInput().getMaxLandUseChange());
addScalar(inDB.addParameter("tradeBarrier", 0), inputData.getCountryInput().getTradeBarrier());
addScalar(inDB.addParameter("landChangeEnergy", 0), inputData.getCountryInput().getLandChangeEnergy());
addScalar(inDB.addParameter("minFeedRate", 0), inputData.getCountryInput().getMinFeedRate());
}
......
......@@ -5,6 +5,7 @@ import java.util.Map;
import ac.ed.lurg.landuse.AreasItem;
import ac.ed.lurg.landuse.CommodityData;
import ac.ed.lurg.landuse.IntensitiesItem;
import ac.ed.lurg.types.CropToDoubleMap;
import ac.ed.lurg.types.CropType;
import ac.sac.raster.RasterSet;
......
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