From eacdf6b2ddd22b635d6036f6f0c890bd60410eb8 Mon Sep 17 00:00:00 2001 From: "ED\\rhenry2" <roslyn.henry@ed.ac.uk> Date: Wed, 14 Dec 2016 16:42:37 +0000 Subject: [PATCH] stocks changes --- src/ac/ed/lurg/country/GlobalPrice.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ac/ed/lurg/country/GlobalPrice.java b/src/ac/ed/lurg/country/GlobalPrice.java index 29c85f29..364758ae 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); -- GitLab