-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from johannah-pik/bugfixHistTimesteps
Bugfix histTimesteps & ICEban trucks, busses
- Loading branch information
Showing
14 changed files
with
116 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: edgeTransport | ||
Title: Prepare EDGE Transport Data for the REMIND model | ||
Version: 2.1.0 | ||
Version: 2.1.1 | ||
Authors@R: c( | ||
person("Johanna", "Hoppe", , "[email protected]", role = c("aut", "cre"), | ||
comment = c(ORCID = "0009-0004-6753-5090")), | ||
|
@@ -18,7 +18,7 @@ Encoding: UTF-8 | |
LazyData: true | ||
RoxygenNote: 7.3.2 | ||
VignetteBuilder: knitr | ||
Date: 2024-08-08 | ||
Date: 2024-08-12 | ||
Config/testthat/edition: 3 | ||
Imports: | ||
rmndt, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#' Apply ICE ban on vehicle types that feature preference factors | ||
#' | ||
#' @author Johanna Hoppe | ||
#' @param preferenceTab data.table including preferences for all levels of the decision tree | ||
#' @param helpers list of helpers | ||
#' @returns Preferences in accordance to the ICE ban policy | ||
#' @import data.table | ||
#' @export | ||
|
||
toolApplyICEbanOnPreferences <- function(preferenceTab, helpers) { | ||
#Ban is applied to EU28 | ||
affectedRegions <- unique(helpers$regionmappingISOto21to12[regionCode12 == "EUR"]$regionCode21) | ||
#affectedRegions <- affectedRegions[!affectedRegions == "UKI"] currently we apply the ban also to UK | ||
preferenceTab[level == "FV" & region %in% affectedRegions & (subsectorL1 == "trn_freight_road" | subsectorL2 == "Bus") & technology %in% c("Liquids", "Gases"), | ||
value := ifelse(period == 2025, 0.98 * value[period == 2015], value), by = c("region","technology")] | ||
preferenceTab[level == "FV" & region %in% affectedRegions & (subsectorL1 == "trn_freight_road" | subsectorL2 == "Bus") & technology %in% c("Liquids", "Gases"), | ||
value := ifelse(period == 2030, 0.75 * value[period == 2015], value), by = c("region","technology")] | ||
preferenceTab[level == "FV" & region %in% affectedRegions & (subsectorL1 == "trn_freight_road" | subsectorL2 == "Bus") & technology %in% c("Liquids", "Gases"), | ||
value := ifelse(period == 2035, 0.3 * value[period == 2015], value), by = c("region","technology")] | ||
preferenceTab[level == "FV" & region %in% affectedRegions & (subsectorL1 == "trn_freight_road" | subsectorL2 == "Bus") & technology %in% c("Liquids", "Gases"), | ||
value := ifelse(period == 2040, 0.2 * value[period == 2015], value), by = c("region","technology")] | ||
preferenceTab[level == "FV" & region %in% affectedRegions & (subsectorL1 == "trn_freight_road" | subsectorL2 == "Bus") & technology %in% c("Liquids", "Gases"), | ||
value := ifelse(period == 2045, 0.1 * value[period == 2015], value), by = c("region","technology")] | ||
preferenceTab[level == "FV" & region %in% affectedRegions & (subsectorL1 == "trn_freight_road" | subsectorL2 == "Bus") & technology %in% c("Liquids", "Gases"), | ||
value := ifelse(period > 2045, value * 0.05, value), by = c("region","technology")] | ||
|
||
if (anyNA(preferenceTab)) stop("Something went wrong with the ICE ban application. Please check toolApplyICEbanOnPreferences()") | ||
|
||
return(preferenceTab) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.