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

Reverted changes in 487 - changing profit max constraint from production to net production

parent 9757d061
No related branches found
No related tags found
No related merge requests found
...@@ -193,8 +193,8 @@ $gdxin ...@@ -193,8 +193,8 @@ $gdxin
TOTAL_LAND_CHANGE_CONSTRAINT(location) .. suitableLandArea(location) =G= sum(crop_less_pasture, area(crop_less_pasture, location)) / (1.0 - unhandledCropRate) + area('pasture', location); TOTAL_LAND_CHANGE_CONSTRAINT(location) .. suitableLandArea(location) =G= sum(crop_less_pasture, area(crop_less_pasture, location)) / (1.0 - unhandledCropRate) + area('pasture', location);
SETASIDE_AREA_CALC(location) .. area('setaside', location) =E= sum(crop_less_pasture, area(crop_less_pasture, location)) * setAsideRate; SETASIDE_AREA_CALC(location) .. area('setaside', location) =E= sum(crop_less_pasture, area(crop_less_pasture, location)) * setAsideRate;
CROP_MAX_PROD_CONSTRAINT(crop) .. production(crop) =L= maxProduction(crop); CROP_MAX_PROD_CONSTRAINT(crop) .. production(crop) - ruminantFeed(crop) - monogastricFeed(crop) =L= maxProduction(crop);
CROP_MIN_PROD_CONSTRAINT(crop) .. production(crop) =G= minProduction(crop); CROP_MIN_PROD_CONSTRAINT(crop) .. production(crop) - ruminantFeed(crop) - monogastricFeed(crop) =G= minProduction(crop);
ANIMAL_MAX_PROD_CONSTRAINT(animal_product) .. production(animal_product) =L= maxProduction(animal_product); ANIMAL_MAX_PROD_CONSTRAINT(animal_product) .. production(animal_product) =L= maxProduction(animal_product);
ANIMAL_MIN_PROD_CONSTRAINT(animal_product) .. production(animal_product) =G= minProduction(animal_product); ANIMAL_MIN_PROD_CONSTRAINT(animal_product) .. production(animal_product) =G= minProduction(animal_product);
......
This diff is collapsed.
...@@ -234,7 +234,7 @@ public class CountryAgent { ...@@ -234,7 +234,7 @@ public class CountryAgent {
for (Map.Entry<CropType, CropUsageData> entry : previousGamsRasterOutput.getCropUsageData().entrySet()) { for (Map.Entry<CropType, CropUsageData> entry : previousGamsRasterOutput.getCropUsageData().entrySet()) {
CropUsageData cropUsage = entry.getValue(); CropUsageData cropUsage = entry.getValue();
CropType crop = entry.getKey(); CropType crop = entry.getKey();
double baseTradeOrProd = (ModelConfig.ORIG_LEAST_COST_MIN) ? cropUsage.getNetImports() : cropUsage.getProduction(); double baseTradeOrProd = (ModelConfig.ORIG_LEAST_COST_MIN) ? cropUsage.getNetImports() : cropUsage.getNetProduction();
double changeUp = 0.0; double changeUp = 0.0;
double changeDown = 0.0; double changeDown = 0.0;
......
...@@ -32,7 +32,7 @@ public class DemandManagerSSP extends AbstractDemandManager { ...@@ -32,7 +32,7 @@ public class DemandManagerSSP extends AbstractDemandManager {
Map<CommodityType, Double> foodDemandMap = new HashMap<CommodityType, Double>(); Map<CommodityType, Double> foodDemandMap = new HashMap<CommodityType, Double>();
if (baseSspData == null || sd == null) { if (baseSspData == null || sd == null) {
LogWriter.printlnWarning(String.format("No baseSspData or ssp for %s, baseYr:%d, year:%d, %s, base:%s, sd:%s. Skipping", ssp_scenario, ModelConfig.BASE_YEAR, year, c.getCountryName(), baseSspData, sd)); LogWriter.printlnError(String.format("No baseSspData or ssp for %s, baseYr:%d, year:%d, %s, base:%s, sd:%s. Skipping", ssp_scenario, ModelConfig.BASE_YEAR, year, c.getCountryName(), baseSspData, sd));
return foodDemandMap; return foodDemandMap;
} }
......
...@@ -94,7 +94,7 @@ public class SspManager { ...@@ -94,7 +94,7 @@ public class SspManager {
return new SspData(pop, gdp); return new SspData(pop, gdp);
} }
else { else {
LogWriter.printlnWarning("Can't find straddling year for " + year + ", " + scenario + ", " + country.getCountryName()); LogWriter.printlnError("Can't find straddling year for " + year + ", " + scenario + ", " + country.getCountryName());
return null; return null;
} }
} }
......
...@@ -41,6 +41,11 @@ public class CropUsageData { ...@@ -41,6 +41,11 @@ public class CropUsageData {
return prod; return prod;
} }
/** return production available after accounting for feed use and seed and waste losses */
public double getNetProduction() {
return prod - ruminantFeed - monogastricFeed;
}
public double getProdCost() { public double getProdCost() {
return prodCost; return prodCost;
} }
......
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