powsybl-core
powsybl-core copied to clipboard
Temporary limits' same duration policy
Describe the current behavior
When adding a new temporary limit to a LoadingLimits
, if another temporary limit has the same acceptable duration, it will be replaced by the new one.
Describe the expected behavior
A new method, LoadingLimitsAdder.useSameDurationPolicy(SameDurationPolicy policy)
should be added to allow to chose the behavior to adopt when adding a new temporary limit having the same acceptable duration as another one.
The possible values are:
-
SameDurationPolicy.THROW
: throw an exception when multiple temporary limits are detected with the same acceptable duration. This should be the default behavior; -
SameDurationPolicy.LAST_ADDED
: keep the last added temporary limit. This is the legacy behavior; -
SameDurationPolicy.MIN_VALUE
: keep the temporary limit which have the minimum value. When the 2 limits have the same value, the first added is kept (i.e. the limit is "updated" in the adder only if the new value is lower than the previous one).
Describe the motivation
It would be useful to be able to choose the behavior to adopt when adding a new temporary limit having the same acceptable duration as another one.
Motivation for the THROW
policy:
Having 2 temporary limits with the same acceptable duration could be considered as a data problem which is hidden by the current behavior, and it could be legit to throw an exception when it is detected.
Motivation for the MIN_VALUE
policy:
During CGMES import, before adding a new temporary limit, a test is made to detect if another temporary limit is already declared with the same acceptable duration. The new temporary limit is added only if its value is lower than the existing one, in order to keep the most constraining limit (see OperationalLimitConversion.addTatl(…)
).
This behavior could be natively supported by the LoadingLimitsAdder
.
Motivation for the LAST_ADDED
policy:
The legacy behavior should still be supported.
Extra Information
No response