Antares_Simulator
Antares_Simulator copied to clipboard
Spinning reserve: input data should be immutable
Description
See https://github.com/AntaresSimulatorTeam/Antares_Simulator/pull/1661#pullrequestreview-1650660261.
To take into account the spinning reserve, we change in place the input timeseries in thermal clusters (calculationOfSpinning()
), at the start of the computation.
We then reverse it later (reverseCalculationOfSpinning
).
That implementation is not safe, in particular when the reserve is 100% we cannot reverse the values of the timeseries. In any case we should only apply the modification on a new object when really needed, otherwise it is very difficult to understand what the timeseries is supposed to contain, at any point of the computation.
We should instead have a getter, or another class member, for the modified timeseries, and use it where needed.