https://github.com/Deltares/Ribasim/pull/1529 refactors the DiscreteControl parameter update code which leads to a nice performance boost. However, not all of the comments raised by @evetion were processed within that PR. One of the raised points was that its not very nice that parameter values that do not have to be updated get the value NaN which is then checked for when setting the parameters.
We came to the conclusion that control states should always be fully defined, that is, a control state should always set all controllable parameters of a node. If a certain optional variable is not set for a control state in the static table, then this variable gets the default value, just as happens in the node parameter initialization. One thing to make sure here is that we keep a single source of truth for what these default parameter values are.
https://github.com/Deltares/Ribasim/pull/1529 refactors the
DiscreteControl
parameter update code which leads to a nice performance boost. However, not all of the comments raised by @evetion were processed within that PR. One of the raised points was that its not very nice that parameter values that do not have to be updated get the valueNaN
which is then checked for when setting the parameters.We came to the conclusion that control states should always be fully defined, that is, a control state should always set all controllable parameters of a node. If a certain optional variable is not set for a control state in the
static
table, then this variable gets the default value, just as happens in the node parameter initialization. One thing to make sure here is that we keep a single source of truth for what these default parameter values are.