Fix .ExtractOutputsModel function to manage the new elements of OutputsModel
The .ExtractOutputsModel() function no longer works because of the addition of the Param and WarmUpQsim elements in the OutputsModel object.
There are several solutions to solve the problem:
- handle each exception in the function
.ExtractOutputsModel()(not recommended from my point of view) - manage the
ParamandWarmUpQsimelements as the different elements ofStateEnd, i.e. in a list
If the second solution is chosen, we need to mange the .GetOutputsModelGR() (UtilsRunModel.R) as following. But the fact that the WarmUpQsim element has a specific "WarmUpOutputsModelItem" class is also a problem.
if ("WarmUpQsim" %in% RunOptions$Outputs_Sim) {
OutputsModel$RunOptions$WarmUpQsim <- RESULTS$Outputs[seq_len(length(RunOptions$IndPeriod_WarmUp)),
which(FortranOutputs == "Qsim")]
class(OutputsModel$RunOptions$WarmUpQsim) <- c("WarmUpOutputsModelItem", class(OutputsModel$RunOptions$WarmUpQsim))
}
if ("Param" %in% RunOptions$Outputs_Sim) {
OutputsModel$RunOptions$Param <- Param
}
.ExtractOutputsModel():
if (!is.null(x$RunOptions)) {
res$RunOptions <- x$RunOptions
}