diff --git a/src/ac/ed/lurg/country/CountryAgentManager.java b/src/ac/ed/lurg/country/CountryAgentManager.java index 25624af5e12a6cf8c576758c6109c0c5207b54b2..8fe33be506e30cd31529f95939d51cd3d4bc69c9 100644 --- a/src/ac/ed/lurg/country/CountryAgentManager.java +++ b/src/ac/ed/lurg/country/CountryAgentManager.java @@ -20,7 +20,6 @@ import ac.ed.lurg.landuse.IrrigationItem; import ac.ed.lurg.landuse.IrrigationRasterSet; import ac.ed.lurg.landuse.LandUseItem; import ac.ed.lurg.types.CropType; -import ac.ed.lurg.utils.LazyHashMap; import ac.ed.lurg.utils.LogWriter; import ac.ed.lurg.yield.YieldRaster; import ac.sac.raster.IntegerRasterItem; diff --git a/src/ac/ed/lurg/landuse/LandUseItem.java b/src/ac/ed/lurg/landuse/LandUseItem.java index 25df57282d2516853fe164a0dbff9d8b394b3087..c59c08aab34c4692fff718ad37f8aedc8b9dcc3f 100644 --- a/src/ac/ed/lurg/landuse/LandUseItem.java +++ b/src/ac/ed/lurg/landuse/LandUseItem.java @@ -319,8 +319,8 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial double proportion = 1.0; if (year < ModelConfig.FORCE_PROTECTED_AREAS_END_YEAR) - proportion = 1.0 - (ModelConfig.FORCE_PROTECTED_AREAS_END_YEAR - year) / (double)(ModelConfig.FORCE_PROTECTED_AREAS_END_YEAR - ModelConfig.FORCE_PROTECTED_AREAS_START_YEAR); - + proportion = 1.0 / (ModelConfig.FORCE_PROTECTED_AREAS_END_YEAR - year); + suitable = Math.max(0, currentAgri + natAvailForAgriExclMinRateSlope * proportion); // netNatAvailForAgri is negative, but suitable area < 0 is not sensible (seems to happen with high barren areas) } else