Commit cabd63ef authored by Dorchies David's avatar Dorchies David
Browse files

fix(RunModel.Supervisor): Difference between RunModel.GRiwrmInputsModel and...

fix(RunModel.Supervisor): Difference between RunModel.GRiwrmInputsModel and RunModel.Supervisor due to initial state handling

- Add a call to RunModel.GRiwrmInputsModel in RunModel.Supervisor on warm-up period in order to get correct iniital states at begginning of simulation at run period

Refs #50
parent 47d4dc4e
...@@ -55,6 +55,19 @@ RunModel.Supervisor <- function(x, RunOptions, Param, ...) { ...@@ -55,6 +55,19 @@ RunModel.Supervisor <- function(x, RunOptions, Param, ...) {
}) })
) )
# Initialisation of model states by running the model with no supervision on warm-up period
RunOptionsWarmUp <- RunOptions
for(id in names(x$InputsModel)) {
RunOptionsWarmUp[[id]]$IndPeriod_Run <- RunOptionsWarmUp[[id]]$IndPeriod_WarmUp
RunOptionsWarmUp[[id]]$IndPeriod_WarmUp <- 0L
RunOptionsWarmUp[[id]]$Outputs_Sim <- c("StateEnd", "Qsim")
}
x$OutputsModel <- suppressMessages(
RunModel.GRiwrmInputsModel(x$InputsModel,
RunOptions = RunOptionsWarmUp,
Param = Param)
)
# Adapt RunOptions to step by step simulation # Adapt RunOptions to step by step simulation
for(id in getSD_Ids(x$InputsModel)) { for(id in getSD_Ids(x$InputsModel)) {
RunOptions[[id]]$IndPeriod_WarmUp <- 0L RunOptions[[id]]$IndPeriod_WarmUp <- 0L
......
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