Deltares / rtc-tools

The Deltares toolbox for control and optimization of environmental systems.
GNU Lesser General Public License v3.0
0 stars 2 forks source link

WIP: Fix initial_state() and history() #1607

Closed SGeeversAtVortech closed 1 month ago

SGeeversAtVortech commented 1 month ago

In GitLab by @vreeken on Sep 17, 2019, 22:35

Before we had the supposed default implementation in OptimizationProblem that history() also returned values in initial_state(), and vice versa. This would never actually work properly, as one would end up in an endless loop.

The reason this bug was not encountered until this point, is that ModelicaMixin did not call super() for initial_state(). Furthermore, PIMixin/IOMixin did not call super() either. So in practice we never got the behavior that history() referred to values in intial_state() and vice versa.

The "mother" method of the two is history(), as this is the only method actually called in CollocatedIntegratedOptimizationProblem. This means that when a user uses any IOMixin class, but implements their own initial_state() method, this method would never actually be called.

To fix this bug, we remove the supposed referral of initial_state() to history() (which was not there in practice), but we keep the call to initial_state() in OptimizationProblem's implementation of history(). We also make sure that all classes properly call their respective super() methods.

Closes #1123

SGeeversAtVortech commented 1 month ago

In GitLab by @vreeken on Sep 17, 2019, 22:55

added 1 commit

Compare with previous version

SGeeversAtVortech commented 1 month ago

In GitLab by @vreeken on Sep 18, 2019, 24:03

marked as a Work In Progress

SGeeversAtVortech commented 1 month ago

In GitLab by @vreeken on Sep 26, 2019, 17:19

unmarked as a Work In Progress

SGeeversAtVortech commented 1 month ago

In GitLab by @vreeken on Sep 26, 2019, 17:19

added 9 commits

Compare with previous version

SGeeversAtVortech commented 1 month ago

In GitLab by @vreeken on Sep 26, 2019, 17:29

marked the checklist item On top of !323 as completed

SGeeversAtVortech commented 1 month ago

In GitLab by @vreeken on Oct 9, 2019, 21:28

marked as a Work In Progress

SGeeversAtVortech commented 1 month ago

In GitLab by @vreeken on Oct 17, 2019, 15:14

Closed in favor of !343

SGeeversAtVortech commented 1 month ago

In GitLab by @vreeken on Oct 17, 2019, 15:14

closed