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

Calibration changes

parent bc98d114
No related branches found
No related tags found
No related merge requests found
......@@ -115,10 +115,10 @@ $gdxin
PASTURE_DECREASE_CONV_CALC(location)
COST_EQ total cost objective function;
UNIT_COST_EQ(crop, location) .. unitCost(crop, location) =E= ( baseCost(crop) +
UNIT_COST_EQ(crop, location) .. unitCost(crop, location) =E= ( baseCost(crop) * 0.5 +
fertiliserUnitCost * fertI(crop, location) +
irrigCost(location) * irrigMaxRate(crop, location) * irrigI(crop, location) +
otherICost * otherIntensity(crop, location)
(baseCost(crop) * 0.5 + otherICost) * otherIntensity(crop, location)
) ;
YIELD_EQ(crop, location) .. yield(crop, location) =E= (
......@@ -133,7 +133,7 @@ $gdxin
(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 - 0.9 * 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);
......@@ -175,10 +175,10 @@ $gdxin
SUM(location,
1.0 * agriLandExpansion(location) +
0.25 * cropIncrease(location) +
0.25 * cropDecrease(location) +
0.25 * pastureIncrease(location) +
0.25 * pastureDecrease(location)
0.5 * cropIncrease(location) +
0.5 * cropDecrease(location) +
0.5 * pastureIncrease(location) +
0.5 * pastureDecrease(location)
) * landChangeCost
) * domesticPriceMarkup +
......
......@@ -17,9 +17,10 @@ CLEANUP_GAMS_DIR=false
# Properties for testing
CHANGE_YIELD_DATA_YEAR=false
CHANGE_DEMAND_YEAR=true
CHANGE_DEMAND_YEAR=false
DEBUG_LIMIT_COUNTRIES=false
SSP_SCENARIO=SSP2_v9_130325
MAX_IMPORT_CHANGE=0
END_TIMESTEP=18
TIMESTEP_SIZE=5
......@@ -27,6 +28,4 @@ TIMESTEP_SIZE=5
NUM_CEREAL_CATEGORIES=5
NUM_PASTURE_CATEGORIES=3
LAND_CHANGE_COST=.8
INTERPOLATE_OUTPUT_YEARS = false
......@@ -163,9 +163,9 @@ public class ModelConfig {
public static final double UNHANDLED_CROP_AREA = getDoubleProperty("UNHANDLED_CROP_AREA", 0.4); // includes fruit veg forage crops set aside and failed crop
public static final double OTHER_INTENSITY_COST = getDoubleProperty("OTHER_INTENSITY_COST", 0.3);
public static final double OTHER_INTENSITY_PARAM = getDoubleProperty("OTHER_INTENSITY_PARAM", 5.0);
public static final double OTHER_INTENSITY_PARAM = getDoubleProperty("OTHER_INTENSITY_PARAM", 3.22);
public static final double IRRIG_COST_SCALE_FACTOR = getDoubleProperty("IRRIG_COST_SCALE_FACTOR", 0.02);
public static final double IRRIG_COST_SCALE_FACTOR = getDoubleProperty("IRRIG_COST_SCALE_FACTOR", 0.01);
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;
......@@ -182,6 +182,5 @@ public class ModelConfig {
public static final boolean DEBUG_LIMIT_COUNTRIES = getBooleanProperty("DEBUG_LIMIT_COUNTRIES", false);
public static final Object DEBUG_COUNTRY_NAME = getProperty("DEBUG_COUNTRY_NAME", "United States of America");
public static final double PASTURE_MAX_IRRIGATION_RATE = getDoubleProperty("DEFAULT_MAX_IRRIGATION_RATE", 50.0); // shouldn't need this but some areas crops don't have a value, but was causing them to be selected
public static int NUM_CALIBRATION_ITERATIONS = getIntProperty("NUM_CALIBRATION_ITERATIONS", 1);
}
\ No newline at end of file
......@@ -322,7 +322,7 @@ public class ModelMain {
if (item == null)
return null;
return item.getLandCoverArea(lcType);
return item.getLandCoverFract(lcType);
}
}.writeOutput();
}
......@@ -339,8 +339,18 @@ public class ModelMain {
Collection<CountryAgent> countryAgents = new HashSet<CountryAgent>();
RasterSet<LandCoverItem> initLC = getInitialLandCover();
Map<CompositeCountry, Map<CropType, CropUsageData>> cropUsageDataMap = new CropUsageReader(compositeCountryManager).getCommodityData();
new RasterOutputer<LandCoverItem>(initLC, "InitialCropland") {
@Override
public Double getValue(RasterKey location) {
LandCoverItem item = results.get(location);
if (item == null)
return null;
return item.getLandCoverFract(LandCoverType.CROPLAND);
}
}.writeOutput();
Map<CompositeCountry, Map<CropType, CropUsageData>> cropUsageDataMap = new CropUsageReader(compositeCountryManager).getCommodityData();
for (CompositeCountry cc : countryGrouping) {
......
......@@ -184,6 +184,10 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem> {
return d == null ? 0.0 : d;
}
public double getLandCoverFract(LandCoverType c) {
return getLandCoverArea(c) / getTotalLandCoverArea();
}
public void setLandCoverArea(LandCoverType c, double d) {
if (Double.isNaN(d) || Double.isInfinite(d))
throw new RuntimeException("AreasItem for " + c + " is " + d);
......
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