Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PLUM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Land Use Lab
PLUM
Commits
189a3f5a
Commit
189a3f5a
authored
3 years ago
by
Bart Arendarczyk
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java
+7
-3
7 additions, 3 deletions
src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java
with
7 additions
and
3 deletions
src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java
+
7
−
3
View file @
189a3f5a
...
@@ -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
);
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment