feat: Multiple Hydro Rule Curves#2829
Conversation
…erage reservoir levels
…h input files reservoir levels should be loaded
This PR is based on the [PR about multiple hydro rule curves](#2829) (CR 24). It suggests quick and easy code improvements. --------- Co-authored-by: guilpier <guillaume.pierre_externe@rte-france.com>
|
| } | ||
|
|
||
| private: | ||
| bool load() final; |
There was a problem hiding this comment.
| bool load() final; | |
| bool load() override final; |
| ScenarizedRuleCurvesLoader(const std::filesystem::path& baseFolder, | ||
| const std::string& areaID, | ||
| TimeSeries& max, | ||
| TimeSeries& avg, | ||
| TimeSeries& min): | ||
| RuleCurvesLoader(baseFolder, areaID, max, avg, min) | ||
| { | ||
| } |
There was a problem hiding this comment.
Simplification - use constructor delegation
| ScenarizedRuleCurvesLoader(const std::filesystem::path& baseFolder, | |
| const std::string& areaID, | |
| TimeSeries& max, | |
| TimeSeries& avg, | |
| TimeSeries& min): | |
| RuleCurvesLoader(baseFolder, areaID, max, avg, min) | |
| { | |
| } | |
| using RuleCurvesLoader::RuleCurvesLoader; |
| StandardRuleCurvesLoader(const std::filesystem::path& baseFolder, | ||
| const std::string& areaID, | ||
| TimeSeries& max, | ||
| TimeSeries& avg, | ||
| TimeSeries& min): | ||
| RuleCurvesLoader(baseFolder, areaID, max, avg, min) | ||
|
|
||
| { | ||
| } |
There was a problem hiding this comment.
Use constructor delegation - see below
|
|
||
| ### Input | ||
|
|
||
| #### New optional feature and compatibility flag for scenarized hydro reservoir levels |
| const char* CompatibilityHydroRuleCurvesToCString( | ||
| const Parameters::Compatibility::HydroRuleCurves mode); |
There was a problem hiding this comment.
unnecessary (no more save functions)
|
|
||
| auto& lowLevel = area.hydro.reservoirLevel[Data::PartHydro::minimum]; | ||
| uint32_t seriesIndex = area.hydro.series->ruleCurves.min.getSeriesIndex(y); | ||
| const auto& lowLevel = area.hydro.series->ruleCurves.min.timeSeries[seriesIndex]; |
There was a problem hiding this comment.
| const auto& lowLevel = area.hydro.series->ruleCurves.min.timeSeries[seriesIndex]; | |
| const auto* lowLevel = area.hydro.series->ruleCurves.min.timeSeries[seriesIndex]; |
| const auto& minRuleCurves = area.hydro.series->ruleCurves.min.getColumn(year); | ||
| const auto& avgRuleCurves = area.hydro.series->ruleCurves.avg.getColumn(year); | ||
| const auto& maxRuleCurves = area.hydro.series->ruleCurves.max.getColumn(year); |
There was a problem hiding this comment.
| const auto& minRuleCurves = area.hydro.series->ruleCurves.min.getColumn(year); | |
| const auto& avgRuleCurves = area.hydro.series->ruleCurves.avg.getColumn(year); | |
| const auto& maxRuleCurves = area.hydro.series->ruleCurves.max.getColumn(year); | |
| const auto* minRuleCurves = area.hydro.series->ruleCurves.min.getColumn(year); | |
| const auto* avgRuleCurves = area.hydro.series->ruleCurves.avg.getColumn(year); | |
| const auto* maxRuleCurves = area.hydro.series->ruleCurves.max.getColumn(year); |
| else | ||
| { | ||
| auto& reservoirLevel = area.hydro.reservoirLevel[Data::PartHydro::average]; | ||
| const auto& ruleCurves = area.hydro.series->ruleCurves.avg.getColumn(y); |
There was a problem hiding this comment.
| const auto& ruleCurves = area.hydro.series->ruleCurves.avg.getColumn(y); | |
| const auto* ruleCurves = area.hydro.series->ruleCurves.avg.getColumn(y); |
| .dayYear; | ||
| auto& minLvl = area.hydro.reservoirLevel[Data::PartHydro::minimum]; | ||
|
|
||
| const auto& minLvl = area.hydro.series->ruleCurves.min.getColumn( |
There was a problem hiding this comment.
| const auto& minLvl = area.hydro.series->ruleCurves.min.getColumn( | |
| const auto* minLvl = area.hydro.series->ruleCurves.min.getColumn( |
| auto& maxLvl = area.hydro | ||
| .reservoirLevel[Data::PartHydro::maximum]; | ||
|
|
||
| const auto& maxLvl = area.hydro.series->ruleCurves.max |
There was a problem hiding this comment.
| const auto& maxLvl = area.hydro.series->ruleCurves.max | |
| const auto* maxLvl = area.hydro.series->ruleCurves.max |
|
Hi @flomnes I'll take a look asap. |
|
@dusanparipovic I think I fixed most of the issues, the PR can finally be merged |
If you want anything additional ping me, I'm looking for contribution on simulator :) @flomnes |
|



This PR implements the Multiple Rule Curves for Hydro Reservoirs as an optional new feature, RTE-I's CR24.