Skip to content
Snippets Groups Projects
Commit c34291a1 authored by Peter Alexander's avatar Peter Alexander
Browse files

Allow base year to not be multiple of 5 in bioenergy demand calc

parent 21c49eaa
No related branches found
No related tags found
No related merge requests found
...@@ -169,7 +169,8 @@ public class BioenergyDemandManager { ...@@ -169,7 +169,8 @@ public class BioenergyDemandManager {
double bioenergyDemandAdj = 0; double bioenergyDemandAdj = 0;
if (ModelConfig.USE_BIOENERGY_TRAJECTORY) { if (ModelConfig.USE_BIOENERGY_TRAJECTORY) {
bioenergyDemandAdj = interpolateDemand(firstGenGlobalMass, year, 5) / firstGenGlobalMass.get(ModelConfig.BASE_YEAR); int baseYear = (ModelConfig.BASE_YEAR/5) * 5; // truncation in division as int
bioenergyDemandAdj = interpolateDemand(firstGenGlobalMass, year, 5) / firstGenGlobalMass.get(baseYear);
} }
else { else {
int yearsOfChange = Math.min(ModelConfig.BIOENERGY_CHANGE_END_YEAR - ModelConfig.BIOENERGY_CHANGE_START_YEAR, year - ModelConfig.BIOENERGY_CHANGE_START_YEAR); int yearsOfChange = Math.min(ModelConfig.BIOENERGY_CHANGE_END_YEAR - ModelConfig.BIOENERGY_CHANGE_START_YEAR, year - ModelConfig.BIOENERGY_CHANGE_START_YEAR);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment