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

Removed animalFeedFromOtherSources as now have fruit and veg so this is not needed

parent fff82814
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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();
}
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
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