diff --git a/GAMS/IntExtOpt.gms b/GAMS/IntExtOpt.gms index 4e157e7f7929095687e534d7ada269ca6b7d4d18..6b558131cfd3a70f3fcccec78b30cb27176729b8 100644 --- a/GAMS/IntExtOpt.gms +++ b/GAMS/IntExtOpt.gms @@ -45,7 +45,6 @@ SCALAR pastureDecCost price for decreasing pasture; SCALAR meatEfficency efficiency of converting feed and pasture into animal products; - SCALAR animalFeedFromOtherSources animal feed from source other than modelled crops; SCALAR fertiliserUnitCost fert cost at max fert rate; SCALAR otherIParam yield response to other intensity; SCALAR otherICost cost of other intensity; @@ -60,15 +59,11 @@ $load location, suitableLandArea, demand, agriExpansionCost, cropIncCost, pastur $load previousArea, previousFertIntensity, previousIrrigIntensity, previousOtherIntensity, previousRuminantFeed, previousMonogastricFeed, previousImportAmount, previousExportAmount $load yieldNone, yieldFertOnly, yieldIrrigOnly, yieldBoth, yieldShock $load fertParam, irrigParam, otherIParam, exportPrices, importPrices, maxNetImport, minNetImport, unhandledCropRate, setAsideRate, maxLandExpansionRate, subsidyRate -$load meatEfficency, otherICost, irrigCost, irrigMaxRate, irrigConstraint, fertiliserUnitCost, domesticPriceMarkup, minDemandPerCereal, minDemandPerOilcrop, seedAndWasteRate, animalFeedFromOtherSources +$load meatEfficency, otherICost, irrigCost, irrigMaxRate, irrigConstraint, fertiliserUnitCost, domesticPriceMarkup, minDemandPerCereal, minDemandPerOilcrop, seedAndWasteRate $gdxin SCALAR delta use to smooth power function see 7.5 www.gams.com dd docs solversconopt.pdf / 0.00000000001 /; - SCALAR ruminantOtherFeed; - SCALAR monogastricOtherFeed; - ruminantOtherFeed = animalFeedFromOtherSources * 0.25; - monogastricOtherFeed = animalFeedFromOtherSources * 0.75; demand(cereal_crop) = demand('cereals') * minDemandPerCereal(cereal_crop); demand(oilpulse_crop) = demand('oilcropspulses') * minDemandPerOilcrop(oilpulse_crop); @@ -177,9 +172,9 @@ $gdxin TOTAL_OIL_PULSE_DEMAND_CONSTRAINT .. sum(oilpulse_crop, net_supply(oilpulse_crop)) =G= demand('oilcropspulses'); - RUMINANT_DEMAND_CONSTRAINT .. meatEfficency*(sum(feed_crop, ruminantFeed(feed_crop) * cropDM(feed_crop)) + ruminantOtherFeed) * (1 - seedAndWasteRate('ruminants')) =G= (demand('ruminants') - importAmount('ruminants') + exportAmount('ruminants')); + RUMINANT_DEMAND_CONSTRAINT .. meatEfficency * sum(feed_crop, ruminantFeed(feed_crop) * cropDM(feed_crop)) * (1 - seedAndWasteRate('ruminants')) =G= (demand('ruminants') - importAmount('ruminants') + exportAmount('ruminants')); - MONOGASTRICS_DEMAND_CONSTRAINT .. meatEfficency*(sum(feed_crop_less_pasture, monogastricFeed(feed_crop_less_pasture) * cropDM(feed_crop_less_pasture)) + monogastricOtherFeed) * (1 - seedAndWasteRate('monogastrics')) =G= (demand('monogastrics') - importAmount('monogastrics') + exportAmount('monogastrics')); + MONOGASTRICS_DEMAND_CONSTRAINT .. meatEfficency * sum(feed_crop_less_pasture, monogastricFeed(feed_crop_less_pasture) * cropDM(feed_crop_less_pasture)) * (1 - seedAndWasteRate('monogastrics')) =G= (demand('monogastrics') - importAmount('monogastrics') + exportAmount('monogastrics')); TOTAL_NON_PASTURE_FEED_DM_CALC .. totalFeedDM =E= sum(feed_crop_less_pasture, (ruminantFeed(feed_crop_less_pasture) + monogastricFeed(feed_crop_less_pasture)) * cropDM(feed_crop_less_pasture)); FEED_MIX_CONSTRAINT(feed_crop_less_pasture) .. (ruminantFeed(feed_crop_less_pasture) + monogastricFeed(feed_crop_less_pasture)) * cropDM(feed_crop_less_pasture) =L= totalFeedDM * 0.7; @@ -254,8 +249,8 @@ $gdxin * Production quantities based on smaller area (before unhandledCropArea adjustment applied) totalProd(crop) = sum(location, area.l(crop, location) * yield.l(crop, location)); productionShock(crop) = sum(location, area.l(crop, location) * yield.l(crop, location) * yieldShock(crop, location)); - totalProd('ruminants') = meatEfficency*(sum(feed_crop, ruminantFeed.l(feed_crop) * cropDM(feed_crop)) + ruminantOtherFeed); - totalProd('monogastrics') = meatEfficency*(sum(feed_crop, monogastricFeed.l(feed_crop) * cropDM(feed_crop)) + monogastricOtherFeed); + totalProd('ruminants') = meatEfficency*(sum(feed_crop, ruminantFeed.l(feed_crop) * cropDM(feed_crop))); + totalProd('monogastrics') = meatEfficency*(sum(feed_crop, monogastricFeed.l(feed_crop) * cropDM(feed_crop))); * Cost based on adjusted area area.l(crop_less_pasture, location) = area.l(crop_less_pasture, location) / (1.0 - unhandledCropRate); diff --git a/src/ac/ed/lurg/ModelMain.java b/src/ac/ed/lurg/ModelMain.java index 6c661ca005d00fd7dffaa0f2d44038e7188fa2be..070cfc7dfc5e71f8999adf19d3adbf90e6fdae7c 100644 --- a/src/ac/ed/lurg/ModelMain.java +++ b/src/ac/ed/lurg/ModelMain.java @@ -74,7 +74,7 @@ public class ModelMain { public static void main(String[] args) { ModelMain theModel = new ModelMain(); - System.out.println("Working Directory = " + System.getProperty("user.dir")); + System.out.println("Working Directory = " + System.getProperty("user.dir")); theModel.setup(); theModel.run(); } diff --git a/src/ac/ed/lurg/country/CountryAgent.java b/src/ac/ed/lurg/country/CountryAgent.java index d133224b6913b7a3408753b2378f767327009e00..6aa7b277f633055ae16745635f9494792ae428a2 100644 --- a/src/ac/ed/lurg/country/CountryAgent.java +++ b/src/ac/ed/lurg/country/CountryAgent.java @@ -38,7 +38,6 @@ public class CountryAgent extends AbstractCountryAgent { private GamsRasterOutput previousGamsRasterOutput; private RasterSet<IntegerRasterItem> yieldClusters; - private double animalFeedFromOtherSources; private Map<CropType, Double> subsidyRates; private boolean saveGamsGdxFiles; @@ -127,11 +126,6 @@ public class CountryAgent extends AbstractCountryAgent { if (saveGamsGdxFiles && ModelConfig.PRICE_ELASTIC_DEMAND) saveGDXFile("demand"); - if (currentTimestep.isInitialTimestep()) { - double totalAnimalProductDemand = currentProjectedDemand.get(CommodityType.MONOGASTRICS) + currentProjectedDemand.get(CommodityType.RUMINANTS); - animalFeedFromOtherSources = totalAnimalProductDemand * ModelConfig.ANIMAL_FEED_FROM_OTHER_SOURCES_RATE; - } - if (currentProjectedDemand.size() == 0) { LogWriter.printlnError("No demand for country " + country + " so skipping it"); } @@ -221,7 +215,7 @@ public class CountryAgent extends AbstractCountryAgent { } GamsCountryInput countryLevelInputs = new GamsCountryInput(country, currentProjectedDemand, currentCountryPrices, importConstraints, - previousGamsRasterOutput.getCropUsageData(), currentMinDemandFract, animalFeedFromOtherSources, subsidyRates); + previousGamsRasterOutput.getCropUsageData(), currentMinDemandFract, subsidyRates); GamsRasterInput input = new GamsRasterInput(currentTimestep, countryYieldSurfaces, previousGamsRasterOutput.getLandUses(), irrigData, countryLevelInputs); return input; diff --git a/src/ac/ed/lurg/country/gams/GamsCountryInput.java b/src/ac/ed/lurg/country/gams/GamsCountryInput.java index b89b7732e68f7ecfa618312a02584f781088d09e..56e8ef9eed73cd23b36da068a236cf196963d308 100644 --- a/src/ac/ed/lurg/country/gams/GamsCountryInput.java +++ b/src/ac/ed/lurg/country/gams/GamsCountryInput.java @@ -19,12 +19,11 @@ public class GamsCountryInput { private Map<CropType, CountryPrice> countryPrices; private Map<CropType, CropUsageData> previousCropUsageData; private Map<CommodityType, Map<CropType, Double>> minDemandFractions; - private double animalFeedFromOtherSources; private Map<CropType, Double> subsidyRates; public GamsCountryInput(CompositeCountry country, Map<CommodityType, Double> projectedDemand, Map<CropType, CountryPrice> countryPrices, Map<CropType, TradeConstraint> importConstraints, Map<CropType, CropUsageData> previousCropUsageData, - Map<CommodityType, Map<CropType, Double>> minDemandFracts, double animalFeedFromOtherSources, Map<CropType, Double> subsidyRates) { + Map<CommodityType, Map<CropType, Double>> minDemandFracts, Map<CropType, Double> subsidyRates) { super(); this.country = country; this.projectedDemand = projectedDemand; @@ -32,7 +31,6 @@ public class GamsCountryInput { this.countryPrices = countryPrices; this.previousCropUsageData = previousCropUsageData; this.minDemandFractions = minDemandFracts; - this.animalFeedFromOtherSources = animalFeedFromOtherSources; this.subsidyRates = subsidyRates; } @@ -82,10 +80,6 @@ public class GamsCountryInput { return minDemandFractions; } - public double getAnimalFeedFromOtherSources() { - return animalFeedFromOtherSources; - } - public Map<CropType, Double> getSubsidyRates() { return subsidyRates; } diff --git a/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java b/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java index 016fa1658df1dfeeda447e4d01a1a2578fa44092..5f7d2f0dd3e92bc12fc3fcede25aa59f29dcf91a 100644 --- a/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java +++ b/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java @@ -310,7 +310,6 @@ public class GamsLocationOptimiser { addScalar(inDB, "unhandledCropRate", ModelConfig.UNHANDLED_CROP_RATE, 3); addScalar(inDB, "setAsideRate", ModelConfig.SETASIDE_RATE, 5); addScalar(inDB, "domesticPriceMarkup", ModelConfig.DOMESTIC_PRICE_MARKUP, 3); - addScalar(inDB, "animalFeedFromOtherSources", countryInput.getAnimalFeedFromOtherSources(), 2); double maxExpansion = 1.0; if (!ModelConfig.IS_CALIBRATION_RUN && countryInput.getCountry().getName().equals("China")) { maxExpansion = ModelConfig.MAX_CHINA_LAND_EXPANSION_RATE;