Enforce non-positivity of the “time_shift” option to “var_expectation_model”

Closes: #70
var-models
Sébastien Villemot 2021-07-06 16:40:20 +02:00
parent 221daeab6f
commit c9d6d9c6f8
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 2 additions and 0 deletions

View File

@ -3368,6 +3368,8 @@ ParsingDriver::var_expectation_model()
it = options_list.num_options.find("time_shift");
if (it != options_list.num_options.end())
time_shift = stoi(it->second);
if (time_shift > 0)
error("The 'time_shift' option must be a non-positive integer");
mod_file->addStatement(make_unique<VarExpectationModelStatement>(model_name, var_expectation_model_expression,
var_model_name, horizon,