Antares_Simulator
Antares_Simulator copied to clipboard
Scenario builder : TS numbers
After reading this issue's presentation, you may see the more extensive discussion : #1557
Currently, the piece of code that sets the TS numbers (for all load / energy production / hydro levels) suffers from several shortcomings. This code is contained in files :
- hydroLevelsData.h/.cpp
- TSnumberData.h/.cpp
The shortcomings are :
- A unbalanced and difficult to read / understand class hierarchy
- Code duplication (apply(...) functions for instance)
- some TS number types (as hydro levels) are treated differently (as they are in a separate branch of the hierarchy) whereas there is no apparent reason for this. For example, as the wind or load, they have one TS number per area and year, don't they ?
- We can even question the way clusters TS numbers are handled (for thermal and renewable, vectors are required in rules.h/.cpp)
To handle this shortcomings, we could try to use dependency injections rather than a class hierarchy to specialize behavior.
A possible target would be to have, in bool Rules::apply()
bool Rules::apply()
{
bool returned_status = true;
for (auto& tsNumberDataCollection : tsNumberdata)
{
returned_status = tsNumberdata.apply(study) && returned_status;
}
return returned_status;
}