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
af467451
"git@git.ecdf.ed.ac.uk:s1707343/commonsense-argmining.git" did not exist on "090ca3b8ca120298bfd143873b4f20a40649aecc"
Commit
af467451
authored
1 year ago
by
Bart Arendarczyk
Browse files
Options
Downloads
Patches
Plain Diff
Wood demand rebasing bug fix.
parent
3097a553
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/demand/ElasticDemandManager.java
+3
-1
3 additions, 1 deletion
src/ac/ed/lurg/demand/ElasticDemandManager.java
with
3 additions
and
1 deletion
src/ac/ed/lurg/demand/ElasticDemandManager.java
+
3
−
1
View file @
af467451
...
...
@@ -194,6 +194,7 @@ public class ElasticDemandManager extends AbstractSSPDemandManager {
Map
<
WoodCommodityType
,
Double
>
woodDemands
=
new
HashMap
<>();
SspData
baseSspData
=
sspManager
.
get
(
ssp_scenario
,
baseYearToRebaseConsumption
,
country
);
double
baseGdpPc
=
baseSspData
.
getGdpPc
();
Map
<
WoodCommodityType
,
Double
>
baseExpCpcMap
=
baseWoodCpcCache
.
get
(
country
);
if
(
baseExpCpcMap
==
null
)
{
// we should only do this in the first year
...
...
@@ -208,9 +209,10 @@ public class ElasticDemandManager extends AbstractSSPDemandManager {
double
newExpCpc
=
entry
.
getValue
();
double
baseExpCpc
=
baseExpCpcMap
.
get
(
commodity
);
double
baseCpc
=
woodDemandManager
.
getBaseDemand
(
country
,
commodity
);
double
cpc
=
rebaseConsumption
(
baseGdpPc
,
baseCpc
,
baseExpCpc
,
gdpPc
,
newExpCpc
);
cpc
=
Math
.
max
(
cpc
,
0
);
// could be negative due to rebasing so need to max 0
// Rebased consumption
double
cpc
=
baseCpc
+
(
newExpCpc
-
baseExpCpc
);
double
d
=
cpc
*
population
;
woodDemands
.
put
(
commodity
,
d
);
}
...
...
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