diff --git a/.Rbuildignore b/.Rbuildignore index 58e9550724581f9a8502b1fd02c5dba72e4681cc..019fe14d61dbf216b28840adc609ebda3a90502b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,4 @@ ^rvgest\.Rproj$ ^\.Rproj\.user$ ^LICENSE\.md$ +^data-raw$ diff --git a/DESCRIPTION b/DESCRIPTION index 30551c58c7ed12d117d79b6a45150a8bf4c6e922..ac7d075ba076ac993047c04f4cb6f9d3b2f6968a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -19,3 +19,5 @@ Imports: lubridate, TSstudio VignetteBuilder: knitr +Depends: + R (>= 2.10) diff --git a/NAMESPACE b/NAMESPACE index 293638656b3e255de9ee2c2c706bfdd0873a9d71..55588b0e9b2981c0369e3222b9da665577674ee5 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -9,10 +9,12 @@ S3method(vgest_read_chrono,Objectives) S3method(vgest_read_chrono,default) S3method(vgest_run_store,Objectives) S3method(vgest_run_store,character) -export(get_objectives) export(get_vobj_ts) +export(lakes) +export(objectives) export(plot_isofrequency) export(plot_isofrequency_lake) +export(rulesets) export(vgest_cost) export(vgest_read) export(vgest_read_all) diff --git a/R/get_objectives.R b/R/get_objectives.R deleted file mode 100644 index cb2f1a9b784f3157f72a13e17deff78336b7971a..0000000000000000000000000000000000000000 --- a/R/get_objectives.R +++ /dev/null @@ -1,60 +0,0 @@ -#' Load objective data for \code{\link{vgest_run}} -#' -#' @param objective_thresholds File location of threshold table -#' @param objective_stations File location of objective station table -#' @param lakes File location of lake table -#' -#' @return A dataframe containing one line by objective and the following columns: -#' -#' - station (character): identifier of the objective station -#' - flood (boolean): TRUE for high flow mitigation objective, and FALSE for low flow support -#' - level (character): code composed with "l" for low-flow and "h" for high flow followed by the number of the level -#' - threshold (numeric): value of the threshold in m3/s -#' - lakes (dataframe): Dataframe containing lake details (name, min storage, max storage) -#' -#' @export -#' -#' @examples -#' # Get objectives stored in IRMaRA package -#' df <- get_objectives() -#' # Objectives at Paris -#' df[df[,"station"] == "PARIS_05",] -#' # Lake details concerning the 40th objective in the table -#' df[57, "lakes"] -get_objectives <- function( - objective_thresholds = app_sys("seine", "objective_thresholds.txt"), - objective_stations = app_sys("seine", "objective_stations.json"), - lakes = app_sys("seine", "lakes.txt") -) { - thresholds <- read.delim(objective_thresholds) - stations <- jsonlite::fromJSON( - readLines(objective_stations) - ) - dfLakes <- read.delim(lakes) - row.names(dfLakes) <- dfLakes$name - bFirst = TRUE - for(iStation in 1:nrow(thresholds)) { - station <- thresholds[iStation, 1] - for(type in c("l", "h")) { - bFlood = (type == "h") - for(level in grep(paste0(type, ".*"), names(thresholds))) { - threshold <- thresholds[iStation, level] - df1 <- data.frame( - station = station, - flood = bFlood, - level = names(thresholds)[level], - threshold = threshold - ) - df1$lakes <- list(dfLakes[stations[[station]]$lakes,]) - if(bFirst) { - df <- df1 - bFirst <- FALSE - } else { - df <- rbind(df, df1) - } - } - } - } - class(df) <- c("Objectives", class(df)) - return(df) -} \ No newline at end of file diff --git a/R/get_vobj_ts.R b/R/get_vobj_ts.R index 2da97414b405e8b1ab9cb6b8c0859dd349d72a12..ee346937cae077284dba672e970d71b76001f797 100644 --- a/R/get_vobj_ts.R +++ b/R/get_vobj_ts.R @@ -10,7 +10,7 @@ #' #' @examples #' \dontrun{ -#' dfTs <- get_vobj_ts(vgest_read_all(get_objectives()[1,], "./database")) +#' dfTs <- get_vobj_ts(vgest_read_all(objectives[1,], "./database")) #' } get_vobj_ts <- function(x) { UseMethod("get_vobj_ts", x) @@ -27,9 +27,9 @@ get_vobj_ts <- function(x) { #' @examples #' \dontrun{ #' # Get the first lake of the first objective -#' dfTs <- get_vobj_ts(vgest_read_all(get_objectives()[1,], "./database")[[1]]) +#' dfTs <- get_vobj_ts(vgest_read_all(objectives[1,], "./database")[[1]]) #' # Can also be done by -#' dfTs <- get_vobj_ts(vgest_read_one(1, get_objectives()[1,], "./database")) +#' dfTs <- get_vobj_ts(vgest_read_one(1, objectives[1,], "./database")) #' } get_vobj_ts.Vobj <- function(x) { # Build the date vector @@ -57,7 +57,7 @@ get_vobj_ts.Vobj <- function(x) { #' #' @examples #' \dontrun{ -#' dfTs <- get_vobj_ts(vgest_read_all(get_objectives()[1,], "./database")) +#' dfTs <- get_vobj_ts(vgest_read_all(objectives[1,], "./database")) #' } get_vobj_ts.ListVobj <-function(x) { lVobjTs <- lapply(x, get_vobj_ts.Vobj) diff --git a/R/lakes.R b/R/lakes.R new file mode 100644 index 0000000000000000000000000000000000000000..2d47ab22de9987ceb51a83d5b3b660292c4c8c32 --- /dev/null +++ b/R/lakes.R @@ -0,0 +1,11 @@ +#' Characteristics of the 4 lakes managed by Seine Grands Lacs +#' +#' @format a [data.frame] with 3 columns: +#' +#' - "name" the name of the river on which the lake is implemented ([character]) +#' - "min" the minimum lake storage in Mm3 ([numeric]) +#' - "max" the maximum lake storage in Mm3 ([numeric]) +#' +#' @source \url{https://www.seinegrandslacs.fr/quatre-lacs-reservoirs-au-coeur-dun-bassin} +#' @export +"lakes" diff --git a/R/objectives.R b/R/objectives.R new file mode 100644 index 0000000000000000000000000000000000000000..778f2630e595bfe8ae58152554d3f2f995ed007c --- /dev/null +++ b/R/objectives.R @@ -0,0 +1,12 @@ +#' Objectives of reservoir management on the Seine River +#' +#' @format a [data.frame] with 5 columns: +#' +#' - "station" the id of the station ([character]) +#' - "flood" a [logical] which is `TRUE` for a flood objective and `FALSE` for a drought objective +#' - "level" a [character] representing the severity of the threshold: "l1" to "l4" for low flow thresholds and "h1" to "h3" for high flow thresholds +#' - "lakes" a [list] which contains a [data.frame] with informations concerning the lakes (See [lakes]) +#' +#' @source Dorchies, D., Thirel, G., Jay-Allemand, M., Chauveau, M., Dehay, F., Bourgin, P.-Y., Perrin, C., Jost, C., Rizzoli, J.-L., Demerliac, S., Thépot, R., 2014. Climate change impacts on multi-objective reservoir management: case study on the Seine River basin, France. International Journal of River Basin Management 12, 265–283. \url{https://doi.org/10.1080/15715124.2013.865636} +#' @export +"objectives" diff --git a/R/plot_isofrequency.R b/R/plot_isofrequency.R index 8b4d744a7c31241aee147046f1bbc2405cbf4a5b..263e9cd88666498d6a14ba907bd169f0b8a178a9 100644 --- a/R/plot_isofrequency.R +++ b/R/plot_isofrequency.R @@ -27,7 +27,7 @@ plot_isofrequency <- function(x, freq, result.dir = "database") { #' #' @param vObj dataframe produced by [vgest_read_one()] and stored in a list by [vgest_read_all()] #' @param frequencies vector of frequencies to plot -#' @param lake lake data extract from column `lakes` of objective data given by [get_objectives()] +#' @param lake lake data extract from column `lakes` of objective data given by [objectives] #' @param top.margin top margin applied on the plot for the title #' #' @return [NULL] diff --git a/R/rulesets.R b/R/rulesets.R new file mode 100644 index 0000000000000000000000000000000000000000..194df1d5274b5ca41e136c184818aa8485731f9b --- /dev/null +++ b/R/rulesets.R @@ -0,0 +1,10 @@ +#' Rule sets used in the reservoir managements +#' +#' @format a [list] with 2 items: +#' +#' - "constraints" [character] description of the constraints apply on the management of the reservoir +#' - "rules" [character] description of rule set selections depending on which constraints are applied +#' +#' @source Dehay, F., 2012. Etude de l’impact du changement climatique sur la gestion des lacs-réservoirs de la Seine (other). Diplôme d’ingénieur de l’ENGEES ,Strasbourg. \url{https://hal.inrae.fr/hal-02597326} +#' @export +"rulesets" diff --git a/R/sysdata.rda b/R/sysdata.rda new file mode 100644 index 0000000000000000000000000000000000000000..81ac5e9c93fdbc396cb616681a4e8a7327842a33 Binary files /dev/null and b/R/sysdata.rda differ diff --git a/R/vgest_cost.R b/R/vgest_cost.R index 4b1cc299e1cec439fb808f98031b7022ff5c352f..a95c00097b5ba0478fcbc6f692ce1a7e0735b595 100644 --- a/R/vgest_cost.R +++ b/R/vgest_cost.R @@ -3,7 +3,7 @@ #' Uses ouput of PaChrono.txt or VObj\[1-4\].dat for the calculation. #' #' @param data Data source, see details -#' @param objective one row of the dataframe given by [get_objectives()] +#' @param objective one row of the dataframe given by [objectives] #' #' @return the total cost for one objective at one station in m3/day #' @rdname vgest_cost @@ -19,7 +19,7 @@ vgest_cost <- function(data, objective) { #' For each lake, it's the mean daily storage for a low-flow support objective and the mean daily available storage capacity for a high flow mitigation objective. #' #' @param Vobj A [matrix] or a [data.frame] with one column by lake, in the same order as `objective$lakes` -#' @param objective one row of the dataframe given by [get_objectives()] +#' @param objective one row of the dataframe given by [objectives] #' #' @return total cost of all the lakes in m3/day #' @@ -39,7 +39,7 @@ vgest_cost_lakes <- function(Vobj, objective) { } -#' @param objective one row of the dataframe given by [get_objectives()] +#' @param objective one row of the dataframe given by [objectives] #' #' @rdname vgest_cost #' @export @@ -47,7 +47,7 @@ vgest_cost_lakes <- function(Vobj, objective) { #' @examples #' \dontrun{ #' # This should be done after the execution of vgest for the concerned objective -#' objective <- get_objectives()[1,] +#' objective <- objectives[1,] #' lResultVobj <- vgest_read_all(objective) #' vgest_cost(lResultVobj, objective) #' } @@ -67,7 +67,7 @@ vgest_cost.ListVobj <- function(data, objective) { #' @examples #' \dontrun{ #' # This should be done after the execution of vgest for the concerned objective -#' objective <- get_objectives()[1,] +#' objective <- objectives[1,] #' lChrono <- vgest_read_chrono(objective) #' vgest_cost(lChrono[[1]], objective) #' } @@ -78,7 +78,7 @@ vgest_cost.Chrono <- function(data, objective) { #' #' @param data the [list] given by [vgest_read_chrono()] -#' @param objective [data.frame] given by [get_objectives()] +#' @param objective [data.frame] given by [objectives] #' #' @return A list with items named \[station\]_\[high/low\]_\[threshold\] containing the total cost for a list of objectives and stations in m3/day #' @rdname vgest_cost @@ -87,7 +87,7 @@ vgest_cost.Chrono <- function(data, objective) { #' @examples #' \dontrun{ #' # This should be done after the execution of vgest for the concerned objective -#' objective <- get_objectives()[1,] +#' objective <- objectives[1,] #' lChronos <- vgest_read_chrono(objective, distributionType = 2) #' vgest_cost(lChronos, objective) #' } diff --git a/R/vgest_read.R b/R/vgest_read.R index 17903dfece647705b83a7c52ab12bf802ce33119..5efe4711d379a3ca1b5ec57efb0716ca50d8a9d7 100644 --- a/R/vgest_read.R +++ b/R/vgest_read.R @@ -48,7 +48,7 @@ vgest_read <- function(file, bFlood) { #' This function is preferred to [vgest_read()] because it builds the path for the file to read. #' #' @param iLake Lake number for the current station -#' @param x one line of the dataframe produced by [get_objectives()] +#' @param x one line of the dataframe produced by [objectives] #' @param result.dir path where results of VGEST runs are stored (See [vgest_run_store()]) #' #' @return dataframe with the content of the `VOBJi.DAT` file @@ -56,7 +56,7 @@ vgest_read <- function(file, bFlood) { #' #' @examples #' \dontrun{ -#' vgest_read_one(1, get_objectives()[1,], "./database") +#' vgest_read_one(1, objectives[1,], "./database") #' } vgest_read_one <- function(iLake, x, result.dir) { sLowHigh <- c("low", "high") @@ -72,7 +72,7 @@ vgest_read_one <- function(iLake, x, result.dir) { #' Read all result files `VOBJi.DAT` for all the lakes of one objective at one station #' -#' @param x one line of the dataframe produced by [get_objectives()] +#' @param x one line of the dataframe produced by [objectives] #' @param result.dir path where results of VGEST runs are stored (See [vgest_run_store()]) #' #' @return list with dataframes produced by @@ -80,7 +80,7 @@ vgest_read_one <- function(iLake, x, result.dir) { #' #' @examples #' \dontrun{ -#' vgest_read_all(get_objectives()[1,], "./database") +#' vgest_read_all(objectives[1,], "./database") #' } vgest_read_all <- function(x, result.dir = "database") { lObj <- lapply(1:nrow(x$lakes[[1]]), vgest_read_one, x, result.dir) diff --git a/R/vgest_read_chrono.R b/R/vgest_read_chrono.R index 462a682c7f696dc9cfe7bd479be30fc6dc0a6145..07ebe73c166bf218e379ba38605d67641a262dff 100644 --- a/R/vgest_read_chrono.R +++ b/R/vgest_read_chrono.R @@ -89,7 +89,7 @@ vgest_read_chrono.default <- function(x, nLakes, distributionType, ...) { #' #' @examples #' \dontrun{ -#' objective <- get_objectives()[1,] +#' objective <- objectives[1,] #' distributionType <- 2 #' vgest_run_store(objective, #' 1, 1, "Q_NAT_1900-2009.txt", diff --git a/R/vgest_run_store.R b/R/vgest_run_store.R index 99a4d6900c1cff78e5d8c12a436330b48306ff56..866c7b7385f9d34f4b21f82ef57ef6c3f1209db7 100644 --- a/R/vgest_run_store.R +++ b/R/vgest_run_store.R @@ -45,7 +45,7 @@ vgest_run_store.character <- function(x, reservoirRuleSet, networkSet, cat(" - OK\n") } -#' @param x row(s) of a [data.frame] provided by [get_objectives()] +#' @param x row(s) of a [data.frame] provided by [objectives] #' #' @export #' @rdname vgest_run_store @@ -54,13 +54,13 @@ vgest_run_store.character <- function(x, reservoirRuleSet, networkSet, #' \dontrun{ #' # Example with `vgest_run_store.Objectives` #' # Running vgest for: -#' # - the first objective returned by `get_objectives()` +#' # - the first objective returned by `objectives` #' # - the first configuration of reservoir rules #' # - the first configuration of network #' # - the naturalized hydrological flows of the file located in DONNEES/Q_NAT_1900-2009.txt #' # - doing the optimization on the period between 01/01/1900 and 31/12/2009 #' # - a task distribution function of present volumes and maximum usable volume replenishment times from the start of time steps -#' vgest_run_store(get_objectives()[1,], +#' vgest_run_store(objectives[1,], #' 1, 1, "Q_NAT_1900-2009.txt", #' "01/01/1900", "31/12/2009", 2) #' diff --git a/inst/seine/lakes.txt b/data-raw/lakes.txt similarity index 100% rename from inst/seine/lakes.txt rename to data-raw/lakes.txt diff --git a/inst/seine/objective_description.txt b/data-raw/objective_description.txt similarity index 100% rename from inst/seine/objective_description.txt rename to data-raw/objective_description.txt diff --git a/inst/seine/objective_stations.json b/data-raw/objective_stations.json similarity index 100% rename from inst/seine/objective_stations.json rename to data-raw/objective_stations.json diff --git a/inst/seine/objective_thresholds.txt b/data-raw/objective_thresholds.txt similarity index 100% rename from inst/seine/objective_thresholds.txt rename to data-raw/objective_thresholds.txt diff --git a/data-raw/rulesets.txt b/data-raw/rulesets.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data-raw/seine_grands_lacs.R b/data-raw/seine_grands_lacs.R new file mode 100644 index 0000000000000000000000000000000000000000..d623aa3244e76cb90d35c7d90a11026e9c69ca9e --- /dev/null +++ b/data-raw/seine_grands_lacs.R @@ -0,0 +1,58 @@ +## code to prepare `seine_grands_lacs` dataset goes here + + +# *** lakes *** +lakes <- read.delim("data-raw/lakes.txt") +row.names(lakes) <- lakes$name + +# *** objectives *** +thresholds <- read.delim("data-raw/objective_thresholds.txt") +stations <- jsonlite::fromJSON( + readLines("data-raw/objective_stations.json") +) +bFirst = TRUE +for(iStation in 1:nrow(thresholds)) { + station <- thresholds[iStation, 1] + for(type in c("l", "h")) { + bFlood = (type == "h") + for(level in grep(paste0(type, ".*"), names(thresholds))) { + threshold <- thresholds[iStation, level] + df1 <- data.frame( + station = station, + flood = bFlood, + level = names(thresholds)[level], + threshold = threshold + ) + df1$lakes <- list(lakes[stations[[station]]$lakes,]) + if(bFirst) { + objectives <- df1 + bFirst <- FALSE + } else { + objectives <- rbind(objectives, df1) + } + } + } +} +class(objectives) <- c("Objectives", class(objectives)) + +# *** rulesets *** +constraints <- c( + "a. Qres (minimum flow) at inlets and at Yonne outlet (inline reservoir)", + "b. Qres at outlets", + "c. Qref (maximum flow) at inlets and outlets", + "d. Priority to hydropower generation on Yonne reservoir (Max outflow of 16m<sup>3</sup>/s)", + "e. QST Gradient flow daily limitation for Yonne reservoir (+/- 2m3/s per day)" +) + +rules <- c( + "All constraints (a+b+c+d+e)", + "1, without Qref (a+b+d+e)", + "1, without Qres at outlet (a+c+d+e)", + "3, without Qref (a+d+e)", + "4, without hydropower priority for Yonne lake (a+e)", + "5, without Yonne outflow variation limitation (a)" +) +rulesets <- list(constraints = constraints, rules = rules) + +# Record data in the package +usethis::use_data(objectives, lakes, rulesets, internal = TRUE, overwrite = TRUE) diff --git a/man/get_objectives.Rd b/man/get_objectives.Rd deleted file mode 100644 index a3b705baba51f5a12b4e1bc86adf5ea407c629b8..0000000000000000000000000000000000000000 --- a/man/get_objectives.Rd +++ /dev/null @@ -1,40 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/get_objectives.R -\name{get_objectives} -\alias{get_objectives} -\title{Load objective data for \code{\link{vgest_run}}} -\usage{ -get_objectives( - objective_thresholds = app_sys("seine", "objective_thresholds.txt"), - objective_stations = app_sys("seine", "objective_stations.json"), - lakes = app_sys("seine", "lakes.txt") -) -} -\arguments{ -\item{objective_thresholds}{File location of threshold table} - -\item{objective_stations}{File location of objective station table} - -\item{lakes}{File location of lake table} -} -\value{ -A dataframe containing one line by objective and the following columns: -\itemize{ -\item station (character): identifier of the objective station -\item flood (boolean): TRUE for high flow mitigation objective, and FALSE for low flow support -\item level (character): code composed with "l" for low-flow and "h" for high flow followed by the number of the level -\item threshold (numeric): value of the threshold in m3/s -\item lakes (dataframe): Dataframe containing lake details (name, min storage, max storage) -} -} -\description{ -Load objective data for \code{\link{vgest_run}} -} -\examples{ -# Get objectives stored in IRMaRA package -df <- get_objectives() -# Objectives at Paris -df[df[,"station"] == "PARIS_05",] -# Lake details concerning the 40th objective in the table -df[57, "lakes"] -} diff --git a/man/get_vobj_ts.Rd b/man/get_vobj_ts.Rd index 0531eaefb8a55185b3db9929a72d47a590a79b81..e44ae2d68e21c5df05760da5564784191ebcc120 100644 --- a/man/get_vobj_ts.Rd +++ b/man/get_vobj_ts.Rd @@ -29,15 +29,15 @@ Use for binding results of several lakes for one objective at one station. } \examples{ \dontrun{ -dfTs <- get_vobj_ts(vgest_read_all(get_objectives()[1,], "./database")) +dfTs <- get_vobj_ts(vgest_read_all(objectives[1,], "./database")) } \dontrun{ # Get the first lake of the first objective -dfTs <- get_vobj_ts(vgest_read_all(get_objectives()[1,], "./database")[[1]]) +dfTs <- get_vobj_ts(vgest_read_all(objectives[1,], "./database")[[1]]) # Can also be done by -dfTs <- get_vobj_ts(vgest_read_one(1, get_objectives()[1,], "./database")) +dfTs <- get_vobj_ts(vgest_read_one(1, objectives[1,], "./database")) } \dontrun{ -dfTs <- get_vobj_ts(vgest_read_all(get_objectives()[1,], "./database")) +dfTs <- get_vobj_ts(vgest_read_all(objectives[1,], "./database")) } } diff --git a/man/lakes.Rd b/man/lakes.Rd new file mode 100644 index 0000000000000000000000000000000000000000..ad5aebf69c4ecea68832e79894870b3052a17ea6 --- /dev/null +++ b/man/lakes.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/lakes.R +\docType{data} +\name{lakes} +\alias{lakes} +\title{Characteristics of the 4 lakes managed by Seine Grands Lacs} +\format{ +a \link{data.frame} with 3 columns: +\itemize{ +\item "name" the name of the river on which the lake is implemented (\link{character}) +\item "min" the minimum lake storage in Mm3 (\link{numeric}) +\item "max" the maximum lake storage in Mm3 (\link{numeric}) +} +} +\source{ +\url{https://www.seinegrandslacs.fr/quatre-lacs-reservoirs-au-coeur-dun-bassin} +} +\usage{ +lakes +} +\description{ +Characteristics of the 4 lakes managed by Seine Grands Lacs +} +\keyword{datasets} diff --git a/man/objectives.Rd b/man/objectives.Rd new file mode 100644 index 0000000000000000000000000000000000000000..bc23e5355ccd9f371bb002815e5553286508b06c --- /dev/null +++ b/man/objectives.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/objectives.R +\docType{data} +\name{objectives} +\alias{objectives} +\title{Objectives of reservoir management on the Seine River} +\format{ +a \link{data.frame} with 5 columns: +\itemize{ +\item "station" the id of the station (\link{character}) +\item "flood" a \link{logical} which is \code{TRUE} for a flood objective and \code{FALSE} for a drought objective +\item "level" a \link{character} representing the severity of the threshold: "l1" to "l4" for low flow thresholds and "h1" to "h3" for high flow thresholds +\item "lakes" a \link{list} which contains a \link{data.frame} with informations concerning the lakes (See \link{lakes}) +} +} +\source{ +Dorchies, D., Thirel, G., Jay-Allemand, M., Chauveau, M., Dehay, F., Bourgin, P.-Y., Perrin, C., Jost, C., Rizzoli, J.-L., Demerliac, S., Thépot, R., 2014. Climate change impacts on multi-objective reservoir management: case study on the Seine River basin, France. International Journal of River Basin Management 12, 265–283. \url{https://doi.org/10.1080/15715124.2013.865636} +} +\usage{ +objectives +} +\description{ +Objectives of reservoir management on the Seine River +} +\keyword{datasets} diff --git a/man/plot_isofrequency_lake.Rd b/man/plot_isofrequency_lake.Rd index be63a95cbd6eee00a6ee12e7d797c269d1c5ea81..0856f9175f866f7c6c7e22e90a36fab30468288f 100644 --- a/man/plot_isofrequency_lake.Rd +++ b/man/plot_isofrequency_lake.Rd @@ -11,7 +11,7 @@ plot_isofrequency_lake(vObj, frequencies, lake, top.margin) \item{frequencies}{vector of frequencies to plot} -\item{lake}{lake data extract from column \code{lakes} of objective data given by \code{\link[=get_objectives]{get_objectives()}}} +\item{lake}{lake data extract from column \code{lakes} of objective data given by \link{objectives}} \item{top.margin}{top margin applied on the plot for the title} } diff --git a/man/rulesets.Rd b/man/rulesets.Rd new file mode 100644 index 0000000000000000000000000000000000000000..a0d24d07428933996c743a9c2254bf08fd0d0927 --- /dev/null +++ b/man/rulesets.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/rulesets.R +\docType{data} +\name{rulesets} +\alias{rulesets} +\title{Rule sets used in the reservoir managements} +\format{ +a \link{list} with 2 items: +\itemize{ +\item "constraints" \link{character} description of the constraints apply on the management of the reservoir +\item "rules" \link{character} description of rule set selections depending on which constraints are applied +} +} +\source{ +Dehay, F., 2012. Etude de l’impact du changement climatique sur la gestion des lacs-réservoirs de la Seine (other). Diplôme d’ingénieur de l’ENGEES ,Strasbourg. \url{https://hal.inrae.fr/hal-02597326} +} +\usage{ +rulesets +} +\description{ +Rule sets used in the reservoir managements +} +\keyword{datasets} diff --git a/man/vgest_cost.Rd b/man/vgest_cost.Rd index 00f2b7d86d69fcc6ae51e5d401d0c6a9b0d47e40..f2b6bf5409867c19bd3b59d6acda5fb93adfddc0 100644 --- a/man/vgest_cost.Rd +++ b/man/vgest_cost.Rd @@ -18,7 +18,7 @@ vgest_cost(data, objective) \arguments{ \item{data}{the \link{list} given by \code{\link[=vgest_read_chrono]{vgest_read_chrono()}}} -\item{objective}{\link{data.frame} given by \code{\link[=get_objectives]{get_objectives()}}} +\item{objective}{\link{data.frame} given by \link{objectives}} } \value{ the total cost for one objective at one station in m3/day @@ -33,19 +33,19 @@ Uses ouput of PaChrono.txt or VObj[1-4].dat for the calculation. \examples{ \dontrun{ # This should be done after the execution of vgest for the concerned objective -objective <- get_objectives()[1,] +objective <- objectives[1,] lResultVobj <- vgest_read_all(objective) vgest_cost(lResultVobj, objective) } \dontrun{ # This should be done after the execution of vgest for the concerned objective -objective <- get_objectives()[1,] +objective <- objectives[1,] lChrono <- vgest_read_chrono(objective) vgest_cost(lChrono[[1]], objective) } \dontrun{ # This should be done after the execution of vgest for the concerned objective -objective <- get_objectives()[1,] +objective <- objectives[1,] lChronos <- vgest_read_chrono(objective, distributionType = 2) vgest_cost(lChronos, objective) } diff --git a/man/vgest_cost_lakes.Rd b/man/vgest_cost_lakes.Rd index a1f97c8b8d4f5905ff51d2bc17f8b55490af5ef1..bfd1c79766baeeb61c3d2377c7900df276c8eb7a 100644 --- a/man/vgest_cost_lakes.Rd +++ b/man/vgest_cost_lakes.Rd @@ -9,7 +9,7 @@ vgest_cost_lakes(Vobj, objective) \arguments{ \item{Vobj}{A \link{matrix} or a \link{data.frame} with one column by lake, in the same order as \code{objective$lakes}} -\item{objective}{one row of the dataframe given by \code{\link[=get_objectives]{get_objectives()}}} +\item{objective}{one row of the dataframe given by \link{objectives}} } \value{ total cost of all the lakes in m3/day diff --git a/man/vgest_read_all.Rd b/man/vgest_read_all.Rd index 367cd4e9fe439222ac06b65f205c2b1138c2bd1d..a2d529a2610fa6d81c4ebc8e24229e09b24fae20 100644 --- a/man/vgest_read_all.Rd +++ b/man/vgest_read_all.Rd @@ -7,7 +7,7 @@ vgest_read_all(x, result.dir = "database") } \arguments{ -\item{x}{one line of the dataframe produced by \code{\link[=get_objectives]{get_objectives()}}} +\item{x}{one line of the dataframe produced by \link{objectives}} \item{result.dir}{path where results of VGEST runs are stored (See \code{\link[=vgest_run_store]{vgest_run_store()}})} } @@ -19,6 +19,6 @@ Read all result files \code{VOBJi.DAT} for all the lakes of one objective at one } \examples{ \dontrun{ -vgest_read_all(get_objectives()[1,], "./database") +vgest_read_all(objectives[1,], "./database") } } diff --git a/man/vgest_read_chrono.Rd b/man/vgest_read_chrono.Rd index 4e681c50e26e1bda475e4c1e7aecde8342369a70..af892d582c4d9bbbb70494024f65df78d8302da0 100644 --- a/man/vgest_read_chrono.Rd +++ b/man/vgest_read_chrono.Rd @@ -67,7 +67,7 @@ The file is saved in RDS format for quicker reading the next time. } \examples{ \dontrun{ -objective <- get_objectives()[1,] +objective <- objectives[1,] distributionType <- 2 vgest_run_store(objective, 1, 1, "Q_NAT_1900-2009.txt", diff --git a/man/vgest_read_one.Rd b/man/vgest_read_one.Rd index 79aff6ff95055eb97e234c0f02d4990f9c04e3e7..a53cd4705ef92b6bb3c8026f9e149a4c4c8ac3ab 100644 --- a/man/vgest_read_one.Rd +++ b/man/vgest_read_one.Rd @@ -9,7 +9,7 @@ vgest_read_one(iLake, x, result.dir) \arguments{ \item{iLake}{Lake number for the current station} -\item{x}{one line of the dataframe produced by \code{\link[=get_objectives]{get_objectives()}}} +\item{x}{one line of the dataframe produced by \link{objectives}} \item{result.dir}{path where results of VGEST runs are stored (See \code{\link[=vgest_run_store]{vgest_run_store()}})} } @@ -21,6 +21,6 @@ This function is preferred to \code{\link[=vgest_read]{vgest_read()}} because it } \examples{ \dontrun{ -vgest_read_one(1, get_objectives()[1,], "./database") +vgest_read_one(1, objectives[1,], "./database") } } diff --git a/man/vgest_run_store.Rd b/man/vgest_run_store.Rd index 8642fe4d272183510a1a30e2f641c3aca828e202..237bf010d67863e75fa148965b341b1df5ca4139 100644 --- a/man/vgest_run_store.Rd +++ b/man/vgest_run_store.Rd @@ -37,7 +37,7 @@ vgest_run_store(x, ...) ) } \arguments{ -\item{x}{row(s) of a \link{data.frame} provided by \code{\link[=get_objectives]{get_objectives()}}} +\item{x}{row(s) of a \link{data.frame} provided by \link{objectives}} \item{...}{other parameter passed to the method \link{vgest_run_store.character}} @@ -77,13 +77,13 @@ Prepare, run and store results of one or several VGEST instances \dontrun{ # Example with `vgest_run_store.Objectives` # Running vgest for: -# - the first objective returned by `get_objectives()` +# - the first objective returned by `objectives` # - the first configuration of reservoir rules # - the first configuration of network # - the naturalized hydrological flows of the file located in DONNEES/Q_NAT_1900-2009.txt # - doing the optimization on the period between 01/01/1900 and 31/12/2009 # - a task distribution function of present volumes and maximum usable volume replenishment times from the start of time steps -vgest_run_store(get_objectives()[1,], +vgest_run_store(objectives[1,], 1, 1, "Q_NAT_1900-2009.txt", "01/01/1900", "31/12/2009", 2)