diff --git a/src/ac/ed/lurg/country/GlobalPrice.java b/src/ac/ed/lurg/country/GlobalPrice.java index 29c85f29b161aa2dd6505a4ef4525c7abbdd09dd..364758ae63e60d9e4e654b1652aab80cb2c53335 100644 --- a/src/ac/ed/lurg/country/GlobalPrice.java +++ b/src/ac/ed/lurg/country/GlobalPrice.java @@ -34,14 +34,14 @@ public class GlobalPrice { return exportAmount; } - public GlobalPrice createWithUpdatedMarketPrices(double imports, double exports, boolean adjustPrice, double stockLevel) { + public GlobalPrice createWithUpdatedMarketPrices(double imports, double exports, boolean adjustPrice) { if (imports > 0 || exports > 0) { double ratio; if (imports > exports) - ratio = (imports-exports)/stockLevel; + ratio = (imports-exports)/imports; else - ratio = (imports-exports)/stockLevel; + ratio = (imports-exports)/exports; double adjustment = adjustPrice ? Math.exp(ratio * ModelConfig.MARKET_LAMBA) : 1.0; return new GlobalPrice(exportPrice * adjustment, imports, exports);