diff --git a/src/ac/ed/lurg/country/CountryAgent.java b/src/ac/ed/lurg/country/CountryAgent.java index 878ef55d53eba42f1127e67ceba4c197bcbb8a39..60787f6af64fa03fd8982d86c3b95d19ade173e3 100644 --- a/src/ac/ed/lurg/country/CountryAgent.java +++ b/src/ac/ed/lurg/country/CountryAgent.java @@ -162,7 +162,7 @@ public class CountryAgent { for (CropType crop : commodity.getCropTypes()) { CropUsageData cropUsage = cropUsages.get(crop); - double prod = cropUsage.getNetProduction(crop.getSeedAndWasteRate()); + double prod = cropUsage.getProduction() *(1-crop.getSeedAndWasteRate()) - cropUsage.getMonogastricFeed() - cropUsage.getRuminantFeed(); totalProd += prod; double minFract = minCerealFracts.containsKey(crop) ? minCerealFracts.get(crop) : 0.0; double netImportsFromMinDemand = minFract * demand - prod; @@ -202,7 +202,8 @@ public class CountryAgent { // simple 1-1 commodity to cereal mappings for (CropType crop : commodity.getCropTypes()) { CropUsageData cropUsage = cropUsages.get(crop); - double netImports = demand - cropUsage.getNetProduction(crop.getSeedAndWasteRate()); + double prod = cropUsage.getProduction() *(1-crop.getSeedAndWasteRate()) - cropUsage.getMonogastricFeed() - cropUsage.getRuminantFeed(); + double netImports = demand - prod; LogWriter.println("Updating net imports single commodity/crop" + commodity + "/" + crop + " to " + netImports); cropUsage.updateNetImports(netImports); } @@ -233,7 +234,7 @@ public class CountryAgent { for (Map.Entry<CropType, CropUsageData> entry : previousGamsRasterOutput.getCropUsageData().entrySet()) { CropUsageData cropUsage = entry.getValue(); CropType crop = entry.getKey(); - double baseTradeOrProd = (ModelConfig.ORIG_LEAST_COST_MIN) ? cropUsage.getNetImports() : cropUsage.getNetProduction(crop.getSeedAndWasteRate()); + double baseTradeOrProd = (ModelConfig.ORIG_LEAST_COST_MIN) ? cropUsage.getNetImports() : cropUsage.getNetProduction(); double changeUp = 0.0; double changeDown = 0.0; diff --git a/src/ac/ed/lurg/landuse/CropUsageData.java b/src/ac/ed/lurg/landuse/CropUsageData.java index c30ec8baab8a79eac7fbe6b8b1bffbc5b97af67d..35e151ce0a7c5f0f1e88ecb481516646cc771b25 100644 --- a/src/ac/ed/lurg/landuse/CropUsageData.java +++ b/src/ac/ed/lurg/landuse/CropUsageData.java @@ -42,8 +42,8 @@ public class CropUsageData { } /** return production available after accounting for feed use and seed and waste losses */ - public double getNetProduction(double seedAndWasteRate) { - return prod *(1-seedAndWasteRate) - ruminantFeed - monogastricFeed; + public double getNetProduction() { + return prod - ruminantFeed - monogastricFeed; } public double getProdCost() {