Skip to content

Commit

Permalink
Merge pull request #272 from jmuessel/master
Browse files Browse the repository at this point in the history
limitBEVPhaseIn
  • Loading branch information
johannah-pik authored Sep 2, 2024
2 parents e57d002 + b6c1b1e commit 0a259ad
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '4208817'
ValidationKey: '4392300'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'edgeTransport: Prepare EDGE Transport Data for the REMIND model'
version: 2.1.1
date-released: '2024-08-12'
version: 2.2.0
date-released: '2024-08-30'
abstract: EDGE-T is a fork of the GCAM transport module https://jgcri.github.io/gcam-doc/energy.html#transportation
with a high level of detail in its representation of technological and modal options.
It is a partial equilibrium model with a nested multinomial logit structure and
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
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.1
Version: 2.2.0
Authors@R: c(
person("Johanna", "Hoppe", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0009-0004-6753-5090")),
Expand All @@ -18,7 +18,7 @@ Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.2
VignetteBuilder: knitr
Date: 2024-08-12
Date: 2024-08-30
Config/testthat/edition: 3
Imports:
rmndt,
Expand Down
24 changes: 13 additions & 11 deletions R/toolUpdateEndogenousCosts.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,16 @@ toolUpdateEndogenousCosts <- function(dataEndoCosts,
}

applyICEban <- function(year, currentMask) {
if (year < 2030){
if (year < 2021){
floorCosts <- currentMask
} else if (year == 2030){
floorCosts <- 0.05
} else if (year > 2030 & year <= 2032){
floorCosts <- strangeICEbanFunction(year, 2030, 0.1, 2032, 0.3)
} else if(year > 2032 & year <= 2034){
floorCosts <- strangeICEbanFunction(year, 2032, 0.3, 2034, 0.5)
} else if (year == 2035){
floorCosts <- 0.6
} else if (year > 2035) {
} else if (year >= 2021 & year <= 2030){
floorCosts <- strangeICEbanFunction(year, 2025, 0.08, 2030, 0.19)
} else if (year > 2030 & year < 2035){
floorCosts <- strangeICEbanFunction(year, 2031, 0.2, 2034, 0.6)
} else if(year == 2035){
floorCosts <- 1
} else if (year > 2035) {
floorCosts <- 2
}
return(floorCosts)
}
Expand All @@ -99,6 +97,7 @@ toolUpdateEndogenousCosts <- function(dataEndoCosts,
policyMask <- rbind(policyMask, policyMaskPHEV)
policyMask <- merge(policyMask, helpers$mitigationTechMap[, c("univocalName", "FVvehvar")], all.x = TRUE, allow.cartesian = TRUE)[, FVvehvar := NULL]


# Change policy mask for ICEs when ban is activated
if (isICEban) {
#Ban is applied to EU28 or EUR in case of REMIND running on 12 regions
Expand All @@ -110,8 +109,11 @@ toolUpdateEndogenousCosts <- function(dataEndoCosts,
policyMask <- rbind(policyMask[!(technology %in% c("Gases", "Hybrid electric") & region %in% affectedRegions)],
copy(policyMaskICEban)[, technology := "Hybrid electric"], copy(policyMaskICEban)[, technology := "Gases"])
setkey(policyMask, region, period, technology)
dt <- policyMask
after <- policyMask

policyMask[technology %in% c("Liquids", "Gases", "Hybrid electric") & region %in% affectedRegions,
policyMask := applyICEban(period, policyMask), by = c("period")]
policyMask := max(policyMask, applyICEban(period, policyMask)), by = c("period")]
}

#check whether policy mask is calculated correctly for respective technologys
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prepare EDGE Transport Data for the REMIND model

R package **edgeTransport**, version **2.1.1**
R package **edgeTransport**, version **2.2.0**

[![CRAN status](https://www.r-pkg.org/badges/version/edgeTransport)](https://cran.r-project.org/package=edgeTransport) [![R build status](https://github.com/pik-piam/edgeTransport/workflows/check/badge.svg)](https://github.com/pik-piam/edgeTransport/actions) [![codecov](https://codecov.io/gh/pik-piam/edgeTransport/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/edgeTransport) [![r-universe](https://pik-piam.r-universe.dev/badges/edgeTransport)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -46,7 +46,7 @@ In case of questions / problems please contact Johanna Hoppe <johanna.hoppe@pik-

To cite package **edgeTransport** in publications use:

Hoppe J, Dirnaichner A, Rottoli M, Muessel J (2024). _edgeTransport: Prepare EDGE Transport Data for the REMIND model_. R package version 2.1.1, <https://github.com/pik-piam/edgeTransport>.
Hoppe J, Dirnaichner A, Rottoli M, Muessel J (2024). _edgeTransport: Prepare EDGE Transport Data for the REMIND model_. R package version 2.2.0, <https://github.com/pik-piam/edgeTransport>.

A BibTeX entry for LaTeX users is

Expand All @@ -55,7 +55,7 @@ A BibTeX entry for LaTeX users is
title = {edgeTransport: Prepare EDGE Transport Data for the REMIND model},
author = {Johanna Hoppe and Alois Dirnaichner and Marianna Rottoli and Jarusch Muessel},
year = {2024},
note = {R package version 2.1.1},
note = {R package version 2.2.0},
url = {https://github.com/pik-piam/edgeTransport},
}
```
48 changes: 31 additions & 17 deletions inst/extdata/genParIncoCostStartVal.csv
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
region;incoCostType;FVvehvar;technology;unit;1990;2005;2010;2020
GLO;Model availability;LDV|4W;BEV;US$2005/veh;100000;100000;100000;10000
GLO;Model availability;LDV|4W;FCEV;US$2005/veh;100000;100000;100000;69300
GLO;Model availability;LDV|4W;Gases;US$2005/veh;100000;100000;100000;69300
GLO;Model availability;LDV|4W;Hybrid electric;US$2005/veh;100000;100000;100000;69300
GLO;Model availability;LDV|4W;BEV;US$2005/veh;100000;100000;100000;13000
GLO;Model availability;LDV|4W;FCEV;US$2005/veh;100000;100000;100000;70000
GLO;Model availability;LDV|4W;Gases;US$2005/veh;100000;100000;100000;80000
GLO;Model availability;LDV|4W;Hybrid electric;US$2005/veh;100000;100000;100000;60000
GLO;ICE inconvenience ;LDV|4W;Liquids;US$2005/veh;0;0;0;0
GLO;Risk aversion;LDV|4W;BEV;US$2005/veh;3800;3800;3800;3800
GLO;Risk aversion;LDV|4W;BEV;US$2005/veh;3800;3800;3800;4000
GLO;Risk aversion;LDV|4W;FCEV;US$2005/veh;3800;3800;3800;3800
GLO;Risk aversion;LDV|4W;Gases;US$2005/veh;3800;3800;3800;3800
GLO;Risk aversion;LDV|4W;Hybrid electric;US$2005/veh;3800;3800;3800;3800
Expand All @@ -13,17 +13,31 @@ GLO;Stations availability;LDV|4W;BEV;US$2005/veh;1000;1000;1000;1000
GLO;Stations availability;LDV|4W;Hybrid electric;US$2005/veh;1000;1000;1000;1000
GLO;Stations availability;LDV|4W;FCEV;US$2005/veh;100000;100000;100000;100000
GLO;Stations availability;LDV|4W;Gases;US$2005/veh;100000;100000;100000;100000
EUR;Model availability;LDV|4W;BEV;US$2005/veh;100000;100000;100000;10000
EUR;Model availability;LDV|4W;FCEV;US$2005/veh;100000;100000;100000;69300
EUR;Model availability;LDV|4W;Gases;US$2005/veh;100000;100000;100000;69300
EUR;Model availability;LDV|4W;Hybrid electric;US$2005/veh;100000;100000;100000;69300
EUR;Model availability;LDV|4W;BEV;US$2005/veh;100000;100000;100000;11000
EUR;Model availability;LDV|4W;FCEV;US$2005/veh;100000;100000;100000;70000
EUR;Model availability;LDV|4W;Gases;US$2005/veh;100000;100000;100000;80000
EUR;Model availability;LDV|4W;Hybrid electric;US$2005/veh;100000;100000;100000;60000
EUR;ICE inconvenience;LDV|4W;Liquids;US$2005/veh;0;0;0;0
EUR;Risk aversion;LDV|4W;BEV;US$2005/veh;3800;3800;3800;3800
EUR;Risk aversion;LDV|4W;FCEV;US$2005/veh;3800;3800;3800;3800
EUR;Risk aversion;LDV|4W;Gases;US$2005/veh;3800;3800;3800;3800
EUR;Risk aversion;LDV|4W;Hybrid electric;US$2005/veh;3800;3800;3800;3800
EUR;Range anxiety;LDV|4W;BEV;US$2005/veh;100000;100000;100000;65000
EUR;Stations availability;LDV|4W;BEV;US$2005/veh;1000;1000;1000;1000
EUR;Risk aversion;LDV|4W;BEV;US$2005/veh;3800;3800;3800;4500
EUR;Risk aversion;LDV|4W;FCEV;US$2005/veh;3800;3800;3800;5000
EUR;Risk aversion;LDV|4W;Gases;US$2005/veh;3800;3800;3800;7000
EUR;Risk aversion;LDV|4W;Hybrid electric;US$2005/veh;3800;3800;3800;3000
EUR;Range anxiety;LDV|4W;BEV;US$2005/veh;100000;100000;100000;70000
EUR;Stations availability;LDV|4W;BEV;US$2005/veh;1000;1000;1000;2000
EUR;Stations availability;LDV|4W;Hybrid electric;US$2005/veh;1000;1000;1000;1000
EUR;Stations availability;LDV|4W;FCEV;US$2005/veh;100000;100000;100000;100000
EUR;Stations availability;LDV|4W;Gases;US$2005/veh;100000;100000;100000;100000
EUR;Stations availability;LDV|4W;FCEV;US$2005/veh;100000;100000;100000;120000
EUR;Stations availability;LDV|4W;Gases;US$2005/veh;100000;100000;100000;160000
CHA;Model availability;LDV|4W;BEV;US$2005/veh;100000;100000;100000;9000
CHA;Model availability;LDV|4W;FCEV;US$2005/veh;100000;100000;100000;70000
CHA;Model availability;LDV|4W;Gases;US$2005/veh;100000;100000;100000;80000
CHA;Model availability;LDV|4W;Hybrid electric;US$2005/veh;100000;100000;100000;50000
CHA;ICE inconvenience ;LDV|4W;Liquids;US$2005/veh;0;0;0;0
CHA;Risk aversion;LDV|4W;BEV;US$2005/veh;3800;3800;3800;3800
CHA;Risk aversion;LDV|4W;FCEV;US$2005/veh;3800;3800;3800;3800
CHA;Risk aversion;LDV|4W;Gases;US$2005/veh;3800;3800;3800;3800
CHA;Risk aversion;LDV|4W;Hybrid electric;US$2005/veh;3800;3800;3800;3800
CHA;Range anxiety;LDV|4W;BEV;US$2005/veh;100000;100000;100000;60000
CHA;Stations availability;LDV|4W;BEV;US$2005/veh;1000;1000;1000;1000
CHA;Stations availability;LDV|4W;Hybrid electric;US$2005/veh;1000;1000;1000;1000
CHA;Stations availability;LDV|4W;FCEV;US$2005/veh;100000;100000;100000;100000
CHA;Stations availability;LDV|4W;Gases;US$2005/veh;100000;100000;100000;100000
34 changes: 17 additions & 17 deletions inst/extdata/scenParIncoCost.csv
Original file line number Diff line number Diff line change
Expand Up @@ -273,36 +273,36 @@ SSP2EU;HydrHype4;LDV|4W;Liquids;targetYear;2027
SSP2EU;HydrHype4;LDV|4W;Liquids;targetValue;0.2
SSP2EU;HydrHype4;LDV|4W;Hybrid electric;ratioPHEV;0.5
SSP2EU;Mix1;LDV|4W;BEV;startYear;2025
SSP2EU;Mix1;LDV|4W;BEV;startValue;0.5
SSP2EU;Mix1;LDV|4W;BEV;startValue;1.2
SSP2EU;Mix1;LDV|4W;BEV;targetYear;2035
SSP2EU;Mix1;LDV|4W;BEV;targetValue;0
SSP2EU;Mix1;LDV|4W;Liquids;startYear;2020
SSP2EU;Mix1;LDV|4W;Liquids;targetYear;2027
SSP2EU;Mix1;LDV|4W;Liquids;startYear;2022
SSP2EU;Mix1;LDV|4W;Liquids;targetYear;2030
SSP2EU;Mix1;LDV|4W;Liquids;targetValue;0
SSP2EU;Mix1;LDV|4W;Hybrid electric;ratioPHEV;0.5
SSP2EU;Mix2;LDV|4W;BEV;startYear;2025
SSP2EU;Mix2;LDV|4W;BEV;startValue;0.65
SSP2EU;Mix2;LDV|4W;BEV;startValue;0.8
SSP2EU;Mix2;LDV|4W;BEV;targetYear;2035
SSP2EU;Mix2;LDV|4W;BEV;targetValue;0.15
SSP2EU;Mix2;LDV|4W;Liquids;startYear;2023
SSP2EU;Mix2;LDV|4W;Liquids;targetYear;2027
SSP2EU;Mix2;LDV|4W;Liquids;targetValue;0.01
SSP2EU;Mix2;LDV|4W;Liquids;startYear;2022
SSP2EU;Mix2;LDV|4W;Liquids;targetYear;2030
SSP2EU;Mix2;LDV|4W;Liquids;targetValue;0.1
SSP2EU;Mix2;LDV|4W;Hybrid electric;ratioPHEV;0.5
SSP2EU;Mix3;LDV|4W;BEV;startYear;2025
SSP2EU;Mix3;LDV|4W;BEV;startValue;0.5
SSP2EU;Mix3;LDV|4W;BEV;startValue;0.4
SSP2EU;Mix3;LDV|4W;BEV;targetYear;2035
SSP2EU;Mix3;LDV|4W;BEV;targetValue;0.1
SSP2EU;Mix3;LDV|4W;Liquids;startYear;2020
SSP2EU;Mix3;LDV|4W;Liquids;targetYear;2045
SSP2EU;Mix3;LDV|4W;Liquids;targetValue;0.7
SSP2EU;Mix3;LDV|4W;Hybrid electric;ratioPHEV;0.5
SSP2EU;Mix3;LDV|4W;BEV;targetValue;0
SSP2EU;Mix3;LDV|4W;Liquids;startYear;2022
SSP2EU;Mix3;LDV|4W;Liquids;targetYear;2055
SSP2EU;Mix3;LDV|4W;Liquids;targetValue;0.5
SSP2EU;Mix3;LDV|4W;Hybrid electric;ratioPHEV;1
SSP2EU;Mix4;LDV|4W;BEV;startYear;2025
SSP2EU;Mix4;LDV|4W;BEV;startValue;1
SSP2EU;Mix4;LDV|4W;BEV;targetYear;2035
SSP2EU;Mix4;LDV|4W;BEV;startValue;0.1
SSP2EU;Mix4;LDV|4W;BEV;targetYear;2045
SSP2EU;Mix4;LDV|4W;BEV;targetValue;0
SSP2EU;Mix4;LDV|4W;Liquids;startYear;2023
SSP2EU;Mix4;LDV|4W;Liquids;startYear;2022
SSP2EU;Mix4;LDV|4W;Liquids;targetYear;2055
SSP2EU;Mix4;LDV|4W;Liquids;targetValue;0.1
SSP2EU;Mix4;LDV|4W;Liquids;targetValue;0.8
SSP2EU;Mix4;LDV|4W;Hybrid electric;ratioPHEV;1.5
SSP2EU;NAV_act;LDV|4W;BEV;startYear;2025
SSP2EU;NAV_act;LDV|4W;BEV;startValue;0.5
Expand Down
2 changes: 1 addition & 1 deletion man/iterativeEdgeTransport.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0a259ad

Please sign in to comment.