Commit 8397d8e6 authored by Dorchies David's avatar Dorchies David
Browse files

feat(vgest): change position of subprogram option

Refs vgest#7
parent b734f816
Pipeline #21703 passed with stage
in 35 seconds
......@@ -13,19 +13,19 @@
#' - line 6: objective type: 0 for low flow support, 1 for high flow lamination
#' - line 7: start of calculation period
#' - line 8: end of calculation period
#' - line 9: code for output format of volume results: 1 for absolute values in m3 , 2 for relative values with respect to Vtot or sum(Vtot)
#' - line 10: code indicating how the flow to be stored is distributed between the reservoirs:
#' - line 9: code indicating which sub programs should be run:
#' - 0: All sub programs
#' - 1: Only backward simulation
#' - line 10: code for output format of volume results: 1 for absolute values in m3 , 2 for relative values with respect to Vtot or sum(Vtot)
#' - line 11: code indicating how the flow to be stored is distributed between the reservoirs:
#' - 1=fixed;
#' - 2=function of present volumes and maximum usable volume replenishment times from the start of time steps;
#' - 3=aimed at balancing the filling rates at the end of the time step;
#' - 4=aiming to balance at the end of the time step the times Tpot of reservoir evolution towards extreme state (see line 11) with average inputs;
#' - 5=aiming to balance at the end of the time step the times Tpot of evolution of the reservoir towards extreme state (see line 11) with given quantity of the contributions of each quantity.
#' - line 11 (used only if 4 or 5 on line 10): code indicating the nature of Tpot :
#' - line 12 (used only if 4 or 5 on line 11): code indicating the nature of Tpot :
#' - 1: Tpot is the minimum potential duration Tpot1 of reconstitution of the maximum usable volume (obtaining V=Vtot or V=0, depending on the nature of the objective (support or rolling) and the direction of the calculations)
#' - 2: Tpot is the minimum potential duration Tpot2 of exhaustion of the usable volume (obtaining V=Vtot or V=0, depending on the nature of the objective (support or rolling) and the direction of the calculations)
#' - line 12: code indicating which sub programs should be run:
#' - 0: All sub programs
#' - 1: Only backward simulation
#'
#' @param reservoirRuleSet rank of the set of parameters describing the reservoirs and their management rules (constraints and local instructions)
#' @param networkSet rank of the set of parameters describing the network
......@@ -72,13 +72,12 @@ vgest_write_batch <- function(reservoirRuleSet, networkSet,
sMode <- as.numeric(bFlood) # 0 for drought, 1 for flood
s <- c(station, reservoirRuleSet, networkSet,
Qfile, objective_file, sMode, startDate, endDate,
formatResult, distributionType)
subPrograms, formatResult, distributionType)
if(distributionType == 1) {
writeLines(as.character(distributionOption), file.path(vgest_location, "PARAMETR", "REGLAGE.txt"))
} else if(distributionType %in% c(4,5)) {
s <- c(s,distributionOption)
}
s <- c(s, subPrograms)
writeLines(s, file.path(vgest_location, "PARAMETR", "CHOIX.txt"))
writeLines(paste("01/01", threshold), file.path(vgest_location, "OBJECTIF", objective_file))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment