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
7d3258f2
Commit
7d3258f2
authored
4 years ago
by
rhenry2
Browse files
Options
Downloads
Patches
Plain Diff
small fix (hopefully)
parent
ed34f530
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ac/ed/lurg/country/gams/GamsRasterOptimiser.java
+3
-0
3 additions, 0 deletions
src/ac/ed/lurg/country/gams/GamsRasterOptimiser.java
src/ac/ed/lurg/landuse/LandUseItem.java
+4
-2
4 additions, 2 deletions
src/ac/ed/lurg/landuse/LandUseItem.java
with
7 additions
and
2 deletions
src/ac/ed/lurg/country/gams/GamsRasterOptimiser.java
+
3
−
0
View file @
7d3258f2
...
...
@@ -129,6 +129,9 @@ public class GamsRasterOptimiser {
double
prevForestToNaturalFraction
=
(
prevNatural
>
0
)
?
prevForestTotal
/
prevNatural
:
0
;
double
prevForestManagedFraction
=
(
prevForestTotal
>
0
)
?
prevManagedForest
/
prevForestTotal
:
0
;
if
(
prevForestToNaturalFraction
>
1.0
)
prevForestToNaturalFraction
=
1.0
;
if
(
prevForestManagedFraction
>
1.0
)
prevForestManagedFraction
=
1.0
;
//this tries to honour spatial distribution of protected areas, force removal of pasture and cropland from protected areas
if
(
ModelConfig
.
FORCE_PROTECTED_AREAS
&&
year
>=
ModelConfig
.
FORCE_PROTECTED_AREAS_START_YEAR
)
{
double
protectedLandShortfall
=
0
;
...
...
This diff is collapsed.
Click to expand it.
src/ac/ed/lurg/landuse/LandUseItem.java
+
4
−
2
View file @
7d3258f2
...
...
@@ -239,10 +239,12 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial
}
public
void
setLandCoverArea
(
LandCoverType
c
,
double
d
)
{
if
(
Double
.
isNaN
(
d
)
||
Double
.
isInfinite
(
d
)
||
d
<
0
)
if
(
Double
.
isNaN
(
d
)
||
Double
.
isInfinite
(
d
))
throw
new
RuntimeException
(
"AreasItem for "
+
c
+
" is "
+
d
);
double
landCover
=
(
d
<
0.0
)
?
0.0
:
d
;
landCoverAreas
.
put
(
c
,
d
);
landCoverAreas
.
put
(
c
,
landCover
);
}
public
double
getTotalLandCoverArea
()
{
...
...
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