Skip to content

Commit

Permalink
Small corrections in get_Reward and Shiny
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliette-Gerbaux committed Aug 25, 2023
1 parent cb18763 commit e94a1cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/Shiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ ui <- shiny::fluidPage(
), #end sidebarPanel

shiny::mainPanel(
shiny::h2("Controls (u) evaluated for each week and for each simulation (sim)"),
shiny::h2("Controls (u) in MWh per week evaluated for each week and for each simulation (sim)"),
DT::dataTableOutput("simulation_constraint")
)

Expand Down
5 changes: 4 additions & 1 deletion R/get_Reward.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ get_Reward <- function(simulation_values = NULL,simulation_names=NULL, pattern =

max_hydro <- dplyr::rename(max_hydro,"P_max"="pump","T_max"="turb")
assertthat::assert_that(min(max_hydro$T_max)>0)
assertthat::assert_that(min(max_hydro$P_max)>0)

# Creating possible controls if none
if(is.null(possible_controls)){
nb_hours <- length(hours)
Expand Down Expand Up @@ -521,6 +521,9 @@ reward_offset <- function(opts, df_reward, u0=c(),mcyears,district_cost= "water
dplyr::rename(week="timeId",ov_cost="OV. COST") %>%
dplyr::select("mcYear","week","ov_cost") %>%
as.data.frame()
if (sum(is.na(u0))>=1){
u0 <- c()
}
if (length(u0)>0){
u0 <- data.frame(week=1:52,u0=u0)
df_reward <- df_reward %>%
Expand Down

0 comments on commit e94a1cd

Please sign in to comment.