diff --git a/src/ac/ed/lurg/ModelMain.java b/src/ac/ed/lurg/ModelMain.java index 06e11cdb4d35b042bf7e296dc893dbb52e02ea34..5d41efaeffd4d2caccbed0dc0444ad2252baa0b7 100644 --- a/src/ac/ed/lurg/ModelMain.java +++ b/src/ac/ed/lurg/ModelMain.java @@ -123,8 +123,6 @@ public class ModelMain { YieldRaster yieldSurfaces = getYieldSurfaces(timestep); // this will wait for the marker file from LPJ if configured to do so getUpdateIrrigationData(timestep, yieldSurfaces); // updating currentIrrigationData - - countryAgents.savePreviousProducerCropPricesForAll(); // When running half earth we can to alter protected areas data at a point in time if(ModelConfig.HALFEARTH && ModelConfig.FORCE_PROTECTED_AREAS_START_YEAR == timestep.getYear() && !ModelConfig.IS_CALIBRATION_RUN) { diff --git a/src/ac/ed/lurg/country/AbstractCountryAgent.java b/src/ac/ed/lurg/country/AbstractCountryAgent.java index f5af8f01cb3cbd8293e39c3fc9a5cdf4da0bdc61..2fee1dab8b8961817677f0a26e9ea11ab58e31fb 100644 --- a/src/ac/ed/lurg/country/AbstractCountryAgent.java +++ b/src/ac/ed/lurg/country/AbstractCountryAgent.java @@ -67,6 +67,7 @@ public abstract class AbstractCountryAgent { protected void calculateProducerCropPrices() { LogWriter.println("calculateProducerCropPrices " + country + " " + currentTimestep); currentProducerCropPrices = getProducerCropPrices(); + LogWriter.println("calculateProducerCropPrices " + country + " " + currentTimestep + " prices now " + currentProducerCropPrices); } protected void calculateExportTax() { @@ -81,6 +82,9 @@ public abstract class AbstractCountryAgent { LogWriter.println(String.format("calculateExportTax: Price Spike: %s: Price increased beyond threshold for %s, newPrice=%.4f, oldPrice=%.4f", country, crop, newPrice, oldPrice)); break; } + else { + LogWriter.println(String.format("calculateExportTax: %s: Price change below threshold for %s, newPrice=%.4f, oldPrice=%.4f", country, crop, newPrice, oldPrice)); + } } } diff --git a/src/ac/ed/lurg/country/CountryAgent.java b/src/ac/ed/lurg/country/CountryAgent.java index 721d666386c13cbaadaec119970cc5d0bdf57453..51eb93e89b376f0db30680f688f5913e6c24cf99 100644 --- a/src/ac/ed/lurg/country/CountryAgent.java +++ b/src/ac/ed/lurg/country/CountryAgent.java @@ -107,8 +107,10 @@ public class CountryAgent extends AbstractCountryAgent { // project demand calculateCountryPricesAndDemand(worldPrices, false); - if (ModelConfig.APPLY_EXPORT_TAXES && !ModelConfig.IS_CALIBRATION_RUN) + if (ModelConfig.APPLY_EXPORT_TAXES && !ModelConfig.IS_CALIBRATION_RUN) { calculateExportTax(); + savePreviousProducerCropPrices(); + } if (saveGamsGdxFiles && ModelConfig.PRICE_ELASTIC_DEMAND) saveGDXFile("demand"); diff --git a/src/ac/ed/lurg/country/CountryAgentManager.java b/src/ac/ed/lurg/country/CountryAgentManager.java index 569e76b1b46c49c880caf022c3abd6127cd587cf..7a9abf49361200c6dee2ad2169964464ef977309 100644 --- a/src/ac/ed/lurg/country/CountryAgentManager.java +++ b/src/ac/ed/lurg/country/CountryAgentManager.java @@ -145,12 +145,6 @@ public class CountryAgentManager { } } - public void savePreviousProducerCropPricesForAll() { - for (CountryAgent ca : gamsCountryAgents) { - ca.savePreviousProducerCropPrices(); - } - } - public void serializeCropUsageForAll() { Map<CompositeCountry, Map<CropType, CropUsageData>> cropUsageDataMap = new HashMap<CompositeCountry, Map<CropType, CropUsageData>>(); for (CountryAgent ca : gamsCountryAgents) {