diff --git a/src/ac/ed/lurg/ModelConfig.java b/src/ac/ed/lurg/ModelConfig.java index 20926b6e58e73cfc38bfc8d1ef24306235a20f5b..9dc548c35d756d5691a0e3552008f37c2f7040b2 100644 --- a/src/ac/ed/lurg/ModelConfig.java +++ b/src/ac/ed/lurg/ModelConfig.java @@ -212,6 +212,7 @@ public class ModelConfig { public static final boolean ACTIVE_TRADE_BARRIERS = getBooleanProperty("ACTIVE_TRADE_BARRIERS", false); // if set to true read in barrier information from file, otherwise use default as above public static final boolean PROTECTED_AREAS_ENABLED = getBooleanProperty("PROTECTED_AREAS_ENABLED", true); + public static final double MIN_NATURAL_RATE = getDoubleProperty("MIN_NATURAL_RATE", 0.10); public static final int NUM_CEREAL_CATEGORIES = getIntProperty("NUM_CEREAL_CATEGORIES", 15); public static final int NUM_PASTURE_CATEGORIES = getIntProperty("NUM_PASTURE_CATEGORIES", 4); diff --git a/src/ac/ed/lurg/landuse/LandUseItem.java b/src/ac/ed/lurg/landuse/LandUseItem.java index f22063e485c6f3266423f9bb18228b03bb85f680..29b630196ec53f1453d434b27f7bf832d83bbdf4 100644 --- a/src/ac/ed/lurg/landuse/LandUseItem.java +++ b/src/ac/ed/lurg/landuse/LandUseItem.java @@ -206,18 +206,16 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial } public double getSuitableLand() { - double d = 0; - - double protectedTotal = ModelConfig.PROTECTED_AREAS_ENABLED ? protectedArea : 0; double totalNatural = getLandCoverArea(LandCoverType.OTHER_NATURAL) + getLandCoverArea(LandCoverType.FOREST); - - if (totalNatural >= protectedTotal) - d += totalNatural - protectedTotal; + double currentAgri = getLandCoverArea(LandCoverType.PASTURE) + getLandCoverArea(LandCoverType.CROPLAND); - d += getLandCoverArea(LandCoverType.PASTURE); - d += getLandCoverArea(LandCoverType.CROPLAND); + double protectedA = ModelConfig.PROTECTED_AREAS_ENABLED ? protectedArea : 0; + double minNatural = (currentAgri+totalNatural) * ModelConfig.MIN_NATURAL_RATE; + double minOrProtectedA = Math.max(protectedA, minNatural); + double unprotectedA = Math.max(0, totalNatural - minOrProtectedA); // if we are already using more than is protected then the unprotectedArea is 0 - return d; + double suitable = currentAgri + unprotectedA; + return suitable; } public double getForestToNaturalFraction() {