Skip to content

Commit

Permalink
Merge pull request #61 from rte-antares-rpackage/dev_v83
Browse files Browse the repository at this point in the history
Evolutions 8.3.2
  • Loading branch information
pl-buiquang authored Oct 19, 2022
2 parents 97d0d9f + 74b1220 commit d48df3f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
8 changes: 4 additions & 4 deletions R/createBindingConstraint.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ createBindingConstraint_ <- function(bindingConstraints,
enabled,
timeStep,
operator,
filter_year_by_year,
filter_synthesis,
filter_year_by_year = "hourly, daily, weekly, monthly, annual",
filter_synthesis = "hourly, daily, weekly, monthly, annual",
coefficients,
overwrite,
links,
Expand All @@ -170,8 +170,8 @@ createBindingConstraint_ <- function(bindingConstraints,
operator = operator
)

# Marginal price granularity (v8.4)
if (opts$antaresVersion >= 840){
# Marginal price granularity (v8.3.2)
if (opts$antaresVersion >= 832){
iniParams$`filter-year-by-year` <- filter_year_by_year
iniParams$`filter-synthesis` <- filter_synthesis
}
Expand Down
8 changes: 8 additions & 0 deletions R/editBindingConstraint.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ editBindingConstraint <- function(name,
enabled = NULL,
timeStep = NULL,
operator = NULL,
filter_year_by_year = NULL,
filter_synthesis = NULL,
coefficients = NULL,
opts = antaresRead::simOptions()) {
assertthat::assert_that(inherits(opts, "simOptions"))
Expand Down Expand Up @@ -93,6 +95,12 @@ editBindingConstraint <- function(name,
if(!is.null(enabled)) iniParams$enabled <- enabled
if(!is.null(timeStep)) iniParams$type <- timeStep
if(!is.null(operator)) iniParams$operator <- operator
if(!is.null(filter_year_by_year)){
if(opts$antaresVersion >= 832) iniParams$`filter-year-by-year` <- filter_year_by_year
}
if(!is.null(filter_synthesis)){
if(opts$antaresVersion >= 832) iniParams$`filter-synthesis` <- filter_synthesis
}

bindingConstraints[[bc_update_pos]]$name <- iniParams$name
bindingConstraints[[bc_update_pos]]$id <- iniParams$id
Expand Down
15 changes: 12 additions & 3 deletions R/updateOptimizationSettings.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' @param include.strategicreserve true or false
#' @param include.spinningreserve true or false
#' @param include.primaryreserve true or false
#' @param include.exportmps true or false
#' @param include.exportmps true or false (since v8.3.2 can take also : none, optim-1, optim-2, both-optims)
#' @param power.fluctuations free modulations, minimize excursions or minimize ramping
#' @param shedding.strategy share margins
#' @param shedding.policy shave peaks or minimize duration
Expand Down Expand Up @@ -83,8 +83,17 @@ updateOptimizationSettings <- function(simplex.range = NULL,
assertthat::assert_that(include.spinningreserve %in% c("true", "false"))
if (!is.null(include.primaryreserve))
assertthat::assert_that(include.primaryreserve %in% c("true", "false"))
if (!is.null(include.exportmps))
assertthat::assert_that(include.exportmps %in% c("true", "false"))
if (!is.null(include.exportmps)){
if (opts$antaresVersion >= 832){
assertthat::assert_that(include.exportmps %in% c("true", "false",
"none", "optim-1", "optim-2", "both-optims"))
if (include.exportmps == "true") include.exportmps <- "both-optims"
if (include.exportmps == "false") include.exportmps <- "none"
} else {
assertthat::assert_that(include.exportmps %in% c("true", "false"))
}
}


if (!is.null(power.fluctuations))
assertthat::assert_that(
Expand Down
6 changes: 6 additions & 0 deletions man/editBindingConstraint.Rd

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

2 changes: 1 addition & 1 deletion man/updateOptimizationSettings.Rd

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

0 comments on commit d48df3f

Please sign in to comment.