Conversation
…erage reservoir levels
…h input files reservoir levels should be loaded
flomnes
left a comment
There was a problem hiding this comment.
This looks very nice, a few minor remarks
- Rename reservoir levels => rule curves
- Place all loading logic into the loader class implementations (single / scenarized)
Thanks !
src/libs/antares/study/area/list.cpp
Outdated
| ret = area.hydro.series->saveToFolder(area.id, buffer, hydroPmax) && ret; | ||
|
|
||
| buffer.clear() << folder << SEP << "input" << SEP << "hydro"; | ||
| ret = area.hydro.series->reservoirLevels.saveToFolder(area.id, buffer) && ret; |
There was a problem hiding this comment.
| ret = area.hydro.series->reservoirLevels.saveToFolder(area.id, buffer) && ret; | |
| ret = area.hydro.series->ruleCurves.saveToFolder(area.id, buffer) && ret; |
There was a problem hiding this comment.
Regarding naming convention, from my point of view, it is natural to stay as it is, since in the Antares documentation we called it reservoir levels. If new Antares Simulator developer starts to work, he would search for object called reservoirLevels, not ruleCurves. Nevertheless, if you don't agree please tell me, It won't be hard to change it. Thanks.
src/libs/antares/study/area/list.cpp
Outdated
| "Value not supported for study.parameters.compatibility.hydroPmax"); | ||
| } | ||
|
|
||
| ret = area.hydro.series->reservoirLevels.loadReservoirLevels( |
There was a problem hiding this comment.
| ret = area.hydro.series->reservoirLevels.loadReservoirLevels( | |
| ret = area.hydro.series->ruleCurves.loadFromFolder( |
| // This functionality will no longer be required once the UI is fully deprecated. | ||
| Matrix<double> standardReservoirLevelMatrix; | ||
|
|
||
| TimeSeriesNumbers& timeseriesNumbers; |
There was a problem hiding this comment.
Place this member before TimeSeries members for initialization reasons
| standardReservoirLevelMatrix.fillColumn(ReservoirLevels::maximum, 1.); | ||
| standardReservoirLevelMatrix.fillColumn(ReservoirLevels::average, 0.5); |
There was a problem hiding this comment.
If standardReservoirLevelMatrix is only required for the GUI, add ui or GUI in it's name
| bool ReservoirLevels::loadReservoirLevels( | ||
| const std::string& areaID, | ||
| const std::filesystem::path& folder, | ||
| bool usedBySolver, | ||
| Parameters::Compatibility::HydroRuleCurves hydroRuleCurves) |
There was a problem hiding this comment.
Isn't there a ReservoirLevelsLoader class ? If so, why does ReservoirLevels still has some code related to loading ?
There was a problem hiding this comment.
I've created RuleCurvesLoaderService class to support this functionality. Please check it out, and if you have additional comments, please add it.
| //! check reservoir levels | ||
| bool checkReservoirLevels(uint year); |
| { | ||
| prepareInflows_.Run(year); | ||
| minGenerationScaling_.Run(year); | ||
| if (!checkReservoirLevels(year)) |
|
Finally, could you point to our repository instead of RTE-i's fork ? |
e8ceb21 to
897a4ec
Compare
This PR implements the Multiple Rule Curves for Hydro Reservoirs as an optional new feature, RTE-I's CR24.
Specification: https://rteinternational.sharepoint.com/:w:/s/AntaresUser'sClub-Interne/EbkQpgbTrtBIkT2jQiIbbaQB8mBLrJWASFaGdXPs3cNA8Q?e=ekSAkf