Relecture réserve: Optimisation / définition du besoin de réserves pour chaque zone [ANT-4174]#3400
Conversation
|
This PR is too big. Please break it up into smaller PRs. |
payetvin
left a comment
There was a problem hiding this comment.
Reviewed mainly the code in src/solver/optimisation/
src/libs/antares/study/area/list.cpp
Outdated
| { | ||
| namespace // anonymous | ||
| { | ||
| static void toLower(std::string& str) |
There was a problem hiding this comment.
use boost::to_lower();
src/libs/antares/study/area/list.cpp
Outdated
| } | ||
| } | ||
|
|
||
| bool readReservesAreaParameters(Area& area, const IniFile::Section& section) |
There was a problem hiding this comment.
Move functions related to reserves in a new file src/libs/antares/study/area/reserves.cpp
list.cpp is too long already
| namespace Antares::Data | ||
| { | ||
|
|
||
| void static errorIfNegativeValue(const std::string& propertyName, |
There was a problem hiding this comment.
Not used, remove or call it somewhere
There was a problem hiding this comment.
Removed definition from header
| std::pair<UnsuppliedSpilled, ReserveName> reserveParticipationUnsuppliedSpilledAt( | ||
| unsigned int index) const | ||
| { | ||
| int column = 0; |
| @@ -0,0 +1,28 @@ | |||
| /* | |||
There was a problem hiding this comment.
Maybe merge all the opt_.*reserves.h together ?
| const int PremierPdtDeLIntervalle, | ||
| const int DernierPdtDeLIntervalle) | ||
| { | ||
| struct ReserveCostsInitializer |
There was a problem hiding this comment.
What's the point of having this struct defined directly in the function instead of outside or in a header ?
There was a problem hiding this comment.
Struct now defined outside
|
|
||
| void ReserveSatisfaction::add(int pays, int reserve, int pdt) | ||
| { | ||
| CAPACITY_RESERVATION& capacityReservation = data.areaReserves[pays] |
| { | ||
| if (!data.Simulation) | ||
| { | ||
| // 24 |
There was a problem hiding this comment.
what does this mean ?
There was a problem hiding this comment.
Every constraint.add function is called twice, once just for counting the constrains (data.Simulation = true) and the second time to implement it into the constraint matrix (data.Simulation = false)
It's the same code as elsewhere in antares
| builder.updateHourWithinWeek(pdt); | ||
|
|
||
| // Thermal clusters reserve participation | ||
| for (auto& [clusterId, reserveParticipation]: |
There was a problem hiding this comment.
const, same for ohter loops below
| int nbTermes = capacityReservation.AllThermalReservesParticipation.size() | ||
| + capacityReservation.AllSTStorageReservesParticipation.size() | ||
| + capacityReservation.AllHydroReservesParticipation.size(); | ||
| if (nbTermes) |
There was a problem hiding this comment.
if (nbTermes == 0)
return;
There's no else, exit and avoid complexity
No description provided.