diff --git a/src/ac/ed/lurg/demand/ElasticDemandManager.java b/src/ac/ed/lurg/demand/ElasticDemandManager.java index 5d37b13ff2e62e3c023e765ad4ee890af5d12d22..46be9b3d7aa061f20b0255039bb2e5f46da87122 100755 --- a/src/ac/ed/lurg/demand/ElasticDemandManager.java +++ b/src/ac/ed/lurg/demand/ElasticDemandManager.java @@ -194,6 +194,7 @@ public class ElasticDemandManager extends AbstractSSPDemandManager { Map<WoodCommodityType, Double> woodDemands = new HashMap<>(); SspData baseSspData = sspManager.get(ssp_scenario, baseYearToRebaseConsumption, country); + double baseGdpPc = baseSspData.getGdpPc(); Map<WoodCommodityType, Double> baseExpCpcMap = baseWoodCpcCache.get(country); if (baseExpCpcMap == null) { // we should only do this in the first year @@ -208,9 +209,10 @@ public class ElasticDemandManager extends AbstractSSPDemandManager { double newExpCpc = entry.getValue(); double baseExpCpc = baseExpCpcMap.get(commodity); double baseCpc = woodDemandManager.getBaseDemand(country, commodity); + double cpc = rebaseConsumption(baseGdpPc, baseCpc, baseExpCpc, gdpPc, newExpCpc); + cpc = Math.max(cpc, 0); // could be negative due to rebasing so need to max 0 // Rebased consumption - double cpc = baseCpc + (newExpCpc - baseExpCpc); double d = cpc * population; woodDemands.put(commodity, d); }