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
aefb2200
Commit
aefb2200
authored
3 months ago
by
jburns10
Browse files
Options
Downloads
Patches
Plain Diff
Interpolate timber intensity limits
parent
b7be932d
No related branches found
Branches containing commit
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
+18
-14
18 additions, 14 deletions
src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java
with
18 additions
and
14 deletions
src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java
+
18
−
14
View file @
aefb2200
...
@@ -246,10 +246,10 @@ public class GamsLocationOptimiser {
...
@@ -246,10 +246,10 @@ public class GamsLocationOptimiser {
double
irrigConstraintFactor
;
double
irrigConstraintFactor
;
switch
(
farmingType
)
{
switch
(
farmingType
)
{
case
CONVENTIONAL:
case
CONVENTIONAL:
irrigConstraintFactor
=
getNegativeExponentialProgression
(
ModelConfig
.
UNPROTECTED_IRRIGATION_CONSTRAINT_FACTOR
);
irrigConstraintFactor
=
getNegativeExponentialProgression
(
ModelConfig
.
UNPROTECTED_IRRIGATION_CONSTRAINT_FACTOR
,
false
);
break
;
break
;
case
RESTRICTED:
case
RESTRICTED:
irrigConstraintFactor
=
getNegativeExponentialProgression
(
ModelConfig
.
PROTECTED_IRRIGATION_CONSTRAINT_FACTOR
);
irrigConstraintFactor
=
getNegativeExponentialProgression
(
ModelConfig
.
PROTECTED_IRRIGATION_CONSTRAINT_FACTOR
,
false
);
break
;
break
;
default
:
default
:
irrigConstraintFactor
=
1.0
;
irrigConstraintFactor
=
1.0
;
...
@@ -402,10 +402,10 @@ public class GamsLocationOptimiser {
...
@@ -402,10 +402,10 @@ public class GamsLocationOptimiser {
double
meatEff
=
ModelConfig
.
getAdjParam
(
"MEAT_EFFICIENCY"
);
double
meatEff
=
ModelConfig
.
getAdjParam
(
"MEAT_EFFICIENCY"
);
double
fertCost
=
ModelConfig
.
getAdjParam
(
"FERTILISER_COST_PER_T"
);
double
fertCost
=
ModelConfig
.
getAdjParam
(
"FERTILISER_COST_PER_T"
);
double
otherIntCost
=
ModelConfig
.
getAdjParam
(
"OTHER_INTENSITY_COST"
);
double
otherIntCost
=
ModelConfig
.
getAdjParam
(
"OTHER_INTENSITY_COST"
);
double
fertLimRestr
=
getNegativeExponentialProgression
(
ModelConfig
.
PROTECTED_CROPLAND_FERTILISER_LIMIT
);
double
fertLimRestr
=
getNegativeExponentialProgression
(
ModelConfig
.
PROTECTED_CROPLAND_FERTILISER_LIMIT
,
false
);
double
otherLimRestr
=
getNegativeExponentialProgression
(
ModelConfig
.
PROTECTED_CROPLAND_OTHER_LIMIT
);
double
otherLimRestr
=
getNegativeExponentialProgression
(
ModelConfig
.
PROTECTED_CROPLAND_OTHER_LIMIT
,
false
);
double
fertLimConv
=
getNegativeExponentialProgression
(
ModelConfig
.
UNPROTECTED_CROPLAND_FERTILISER_LIMIT
);
double
fertLimConv
=
getNegativeExponentialProgression
(
ModelConfig
.
UNPROTECTED_CROPLAND_FERTILISER_LIMIT
,
false
);
double
otherLimConv
=
getNegativeExponentialProgression
(
ModelConfig
.
UNPROTECTED_CROPLAND_OTHER_LIMIT
);
double
otherLimConv
=
getNegativeExponentialProgression
(
ModelConfig
.
UNPROTECTED_CROPLAND_OTHER_LIMIT
,
false
);
LogWriter
.
print
(
"\n"
,
3
);
LogWriter
.
print
(
"\n"
,
3
);
...
@@ -471,9 +471,12 @@ public class GamsLocationOptimiser {
...
@@ -471,9 +471,12 @@ public class GamsLocationOptimiser {
// Prices
// Prices
setGamsParamValue
(
importPriceP
.
addRecord
(
"wood"
),
countryInput
.
getWoodPrice
().
getImportPrice
()
,
-
1
);
setGamsParamValue
(
importPriceP
.
addRecord
(
"wood"
),
countryInput
.
getWoodPrice
().
getImportPrice
()
,
-
1
);
setGamsParamValue
(
exportPriceP
.
addRecord
(
"wood"
),
countryInput
.
getWoodPrice
().
getExportPrice
(),
-
1
);
setGamsParamValue
(
exportPriceP
.
addRecord
(
"wood"
),
countryInput
.
getWoodPrice
().
getExportPrice
(),
-
1
);
addScalar
(
inDB
,
"timberLimProtected"
,
ModelConfig
.
PROTECTED_TIMBER_INTENSITY_LIMIT
,
-
1
);
double
timberLimPro
=
getNegativeExponentialProgression
(
ModelConfig
.
PROTECTED_TIMBER_INTENSITY_LIMIT
,
true
);
addScalar
(
inDB
,
"timberLimUnprotected"
,
ModelConfig
.
UNPROTECTED_TIMBER_INTENSITY_LIMIT
,
-
1
);
double
timberLimUnpro
=
getNegativeExponentialProgression
(
ModelConfig
.
UNPROTECTED_TIMBER_INTENSITY_LIMIT
,
true
);
addScalar
(
inDB
,
"timberLimProtected"
,
timberLimPro
,
-
1
);
addScalar
(
inDB
,
"timberLimUnprotected"
,
timberLimUnpro
,
-
1
);
addScalar
(
inDB
,
"forestManagementCost"
,
addScalar
(
inDB
,
"forestManagementCost"
,
ModelConfig
.
getAdjParam
(
"FOREST_MANAGEMENT_COST"
)
*
calibrationItem
.
getForestryCostFactor
(),
-
1
);
ModelConfig
.
getAdjParam
(
"FOREST_MANAGEMENT_COST"
)
*
calibrationItem
.
getForestryCostFactor
(),
-
1
);
...
@@ -939,19 +942,20 @@ public class GamsLocationOptimiser {
...
@@ -939,19 +942,20 @@ public class GamsLocationOptimiser {
return
linearProgression
;
return
linearProgression
;
}
}
private
double
getNegativeExponentialProgression
(
double
constraintFactor
)
{
private
double
getNegativeExponentialProgression
(
double
constraintFactor
,
boolean
isForestryLimit
)
{
int
currentYear
=
inputData
.
getTimestep
().
getYear
();
int
currentYear
=
inputData
.
getTimestep
().
getYear
();
int
startYear
=
ModelConfig
.
INTENSITY_LIMIT_START_YEAR
;
int
startYear
=
ModelConfig
.
INTENSITY_LIMIT_START_YEAR
;
int
endYear
=
ModelConfig
.
INTENSITY_LIMIT_END_YEAR
;
int
endYear
=
ModelConfig
.
INTENSITY_LIMIT_END_YEAR
;
double
linearProgressionAdjustmentRatio
=
(
double
)(
currentYear
-
startYear
)
/
(
endYear
-
startYear
);
double
linearProgressionAdjustmentRatio
=
(
double
)(
currentYear
-
startYear
)
/
(
endYear
-
startYear
);
int
decayFactor
=
ModelConfig
.
INTENSITY_LIMIT_DECAY_FACTOR
;
double
startValue
=
isForestryLimit
?
0.1
:
1.0
;
int
decayFactor
=
ModelConfig
.
INTENSITY_LIMIT_DECAY_FACTOR
;
double
exponentialProgression
=
constraintFactor
+
(
1
-
constraintFactor
)
*
double
exponentialProgression
=
constraintFactor
+
(
startValue
-
constraintFactor
)
*
Math
.
exp
(-
decayFactor
*
linearProgressionAdjustmentRatio
);
Math
.
exp
(-
decayFactor
*
linearProgressionAdjustmentRatio
);
// Bound between
0 and 1
// Bound between
constraintFactor and startValue
exponentialProgression
=
Math
.
min
(
exponentialProgression
,
1
);
exponentialProgression
=
Math
.
min
(
exponentialProgression
,
startValue
);
exponentialProgression
=
Math
.
max
(
exponentialProgression
,
constraintFactor
);
exponentialProgression
=
Math
.
max
(
exponentialProgression
,
constraintFactor
);
return
exponentialProgression
;
return
exponentialProgression
;
...
...
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