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
59526b0f
Commit
59526b0f
authored
7 years ago
by
R0slyn
Browse files
Options
Downloads
Patches
Plain Diff
changes to protected areas setup
parent
d2f9a27d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/ac/ed/lurg/ModelMain.java
+1
-0
1 addition, 0 deletions
src/ac/ed/lurg/ModelMain.java
src/ac/ed/lurg/landuse/LandCoverItem.java
+6
-2
6 additions, 2 deletions
src/ac/ed/lurg/landuse/LandCoverItem.java
src/ac/ed/lurg/landuse/LandUseItem.java
+12
-6
12 additions, 6 deletions
src/ac/ed/lurg/landuse/LandUseItem.java
with
19 additions
and
8 deletions
src/ac/ed/lurg/ModelMain.java
+
1
−
0
View file @
59526b0f
...
...
@@ -583,6 +583,7 @@ public class ModelMain {
areasItem
.
setCropFraction
(
CropType
.
WHEAT
,
0.5
);
// random start as don't have better data
areasItem
.
setCropFraction
(
CropType
.
MAIZE
,
0.5
);
areasItem
.
setProtectedArea
(
landCover
.
getProtectedArea
());
areasItem
.
setUnavailableFract
(
landCover
.
getUnavailableFract
());
landUseRaster
.
put
(
key
,
areasItem
);
}
//outputAreas(initialLC);
...
...
This diff is collapsed.
Click to expand it.
src/ac/ed/lurg/landuse/LandCoverItem.java
+
6
−
2
View file @
59526b0f
...
...
@@ -43,8 +43,12 @@ public class LandCoverItem implements RasterItem {
this
.
proportionProtectedFract
=
proportionProtectedFract
;
}
public
double
getProtectedArea
(){
return
Math
.
max
(
proportionProtectedFract
,
unavailableFract
)*
totalArea
;
public
double
getProtectedArea
(){
return
proportionProtectedFract
*
totalArea
;
}
public
double
getUnavailableFract
(){
return
unavailableFract
;
}
public
void
setMaxCropFraction
(
double
maxCropFraction
){
...
...
This diff is collapsed.
Click to expand it.
src/ac/ed/lurg/landuse/LandUseItem.java
+
12
−
6
View file @
59526b0f
...
...
@@ -20,6 +20,7 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial
private
Map
<
CropType
,
Double
>
cropFractions
=
new
HashMap
<
CropType
,
Double
>();
private
Map
<
LandCoverType
,
Double
>
landCoverAreas
=
new
HashMap
<
LandCoverType
,
Double
>();
private
double
protectedArea
;
//protected area in Mha
private
double
unavailableFract
;
//area unavailable due to altitude etc
public
LandUseItem
()
{}
...
...
@@ -36,15 +37,16 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial
}
public
double
getProtectedAreaIncMinNatural
()
{
double
protectedLand
=
0
;
double
minOrProtectedA
=
0
;
double
protectedA
=
0
;
double
minNatural
=
getTotalLandCoverArea
()
*
ModelConfig
.
MIN_NATURAL_RATE
;
if
(
ModelConfig
.
PROTECTED_AREAS_ENABLED
)
protectedLand
=
protectedArea
;
if
(
ModelConfig
.
PROTECTED_AREAS_ENABLED
)
{
protectedA
=
protectedArea
;
}
double
unprotectedLand
=
getTotalLandCoverArea
()-
protectedLand
;
double
unsuitableLand
=
Math
.
max
(
unprotectedLand
*
ModelConfig
.
MIN_NATURAL_RATE
,
unprotectedLand
*
unavailableFract
);
minOrProtectedA
=
Math
.
max
(
protectedA
,
minNatural
)
;
minOrProtectedA
=
protectedLand
+
unsuitableLand
;
return
minOrProtectedA
;
}
...
...
@@ -363,4 +365,8 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial
public
String
toString
()
{
return
"LandUseItem: [landCoverAreas="
+
landCoverAreas
+
", protectedArea="
+
protectedArea
+
"], suitableLand "
+
getSuitableLand
();
}
public
void
setUnavailableFract
(
double
unavailableFract
)
{
this
.
unavailableFract
=
unavailableFract
;
}
}
\ No newline at end of file
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