From c9d6d9c6f835f7252bb2cee3fd6eede01257a969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Tue, 6 Jul 2021 16:40:20 +0200 Subject: [PATCH] =?UTF-8?q?Enforce=20non-positivity=20of=20the=20=E2=80=9C?= =?UTF-8?q?time=5Fshift=E2=80=9D=20option=20to=20=E2=80=9Cvar=5Fexpectatio?= =?UTF-8?q?n=5Fmodel=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: #70 --- src/ParsingDriver.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ParsingDriver.cc b/src/ParsingDriver.cc index df1ffa58..63612168 100644 --- a/src/ParsingDriver.cc +++ b/src/ParsingDriver.cc @@ -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(model_name, var_expectation_model_expression, var_model_name, horizon,