Skip to content
Snippets Groups Projects
Commit ce63cc2e authored by Peter Alexander's avatar Peter Alexander
Browse files

Add min natural area

parent c906bc38
No related branches found
No related tags found
No related merge requests found
...@@ -212,6 +212,7 @@ public class ModelConfig { ...@@ -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 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 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_CEREAL_CATEGORIES = getIntProperty("NUM_CEREAL_CATEGORIES", 15);
public static final int NUM_PASTURE_CATEGORIES = getIntProperty("NUM_PASTURE_CATEGORIES", 4); public static final int NUM_PASTURE_CATEGORIES = getIntProperty("NUM_PASTURE_CATEGORIES", 4);
......
...@@ -206,18 +206,16 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial ...@@ -206,18 +206,16 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial
} }
public double getSuitableLand() { public double getSuitableLand() {
double d = 0;
double protectedTotal = ModelConfig.PROTECTED_AREAS_ENABLED ? protectedArea : 0;
double totalNatural = getLandCoverArea(LandCoverType.OTHER_NATURAL) + getLandCoverArea(LandCoverType.FOREST); double totalNatural = getLandCoverArea(LandCoverType.OTHER_NATURAL) + getLandCoverArea(LandCoverType.FOREST);
double currentAgri = getLandCoverArea(LandCoverType.PASTURE) + getLandCoverArea(LandCoverType.CROPLAND);
if (totalNatural >= protectedTotal)
d += totalNatural - protectedTotal;
d += getLandCoverArea(LandCoverType.PASTURE); double protectedA = ModelConfig.PROTECTED_AREAS_ENABLED ? protectedArea : 0;
d += getLandCoverArea(LandCoverType.CROPLAND); 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() { public double getForestToNaturalFraction() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment