Skip to content
Snippets Groups Projects
Commit 189a3f5a authored by Bart Arendarczyk's avatar Bart Arendarczyk
Browse files

Minor change to deal with missing values in carbon/wood files.

parent 50906f96
No related branches found
No related tags found
No related merge requests found
...@@ -347,13 +347,16 @@ public class GamsLocationOptimiser { ...@@ -347,13 +347,16 @@ public class GamsLocationOptimiser {
String locString = Integer.toString(locationId); String locString = Integer.toString(locationId);
CarbonFluxItem cFlux = entry.getValue(); CarbonFluxItem cFlux = entry.getValue();
for (LandCoverType prevLC : LandCoverType.getConvertibleTypes()) { for (LandCoverType prevLC : LandCoverType.getConvertibleTypes()) {
for (LandCoverType newLC : LandCoverType.getConvertibleTypes()) { for (LandCoverType newLC : LandCoverType.getConvertibleTypes()) {
Vector<String> v = new Vector<String>(); Vector<String> v = new Vector<String>();
v.add(prevLC.getName()); v.add(prevLC.getName());
v.add(newLC.getName()); v.add(newLC.getName());
v.add(locString); v.add(locString);
setGamsParamValue(cFluxRateP.addRecord(v), cFlux.getCarbonFlux(prevLC, newLC), 3); // TODO Need a better way to deal with missing values
if (cFlux.checkForKeys(prevLC, newLC))
setGamsParamValue(cFluxRateP.addRecord(v), cFlux.getCarbonFlux(prevLC, newLC), 3);
} }
} }
} }
...@@ -365,14 +368,15 @@ public class GamsLocationOptimiser { ...@@ -365,14 +368,15 @@ public class GamsLocationOptimiser {
Integer locationId = entry.getKey(); Integer locationId = entry.getKey();
String locString = Integer.toString(locationId); String locString = Integer.toString(locationId);
WoodYieldItem wYield = entry.getValue(); WoodYieldItem wYield = entry.getValue();
for (LandCoverType prevLC : LandCoverType.getConvertibleTypes()) { for (LandCoverType prevLC : LandCoverType.getConvertibleTypes()) {
for (LandCoverType newLC : LandCoverType.getConvertibleTypes()) { for (LandCoverType newLC : LandCoverType.getConvertibleTypes()) {
Vector<String> v = new Vector<String>(); Vector<String> v = new Vector<String>();
v.add(prevLC.getName()); v.add(prevLC.getName());
v.add(newLC.getName()); v.add(newLC.getName());
v.add(locString); v.add(locString);
setGamsParamValue(woodYieldP.addRecord(v), wYield.getWoodYield(prevLC, newLC), 3); if (wYield.checkForKeys(prevLC, newLC))
setGamsParamValue(woodYieldP.addRecord(v), wYield.getWoodYield(prevLC, newLC), 3);
} }
} }
} }
......
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