Skip to content

Relecture réserve: Optimisation / définition du besoin de réserves pour chaque zone [ANT-4174]#3400

Open
payetvin wants to merge 10 commits intofeature/reserve_model_lot3_scalianfrom
feature/reserve_model_lot3_scalian-besoin-zone
Open

Relecture réserve: Optimisation / définition du besoin de réserves pour chaque zone [ANT-4174]#3400
payetvin wants to merge 10 commits intofeature/reserve_model_lot3_scalianfrom
feature/reserve_model_lot3_scalian-besoin-zone

Conversation

@payetvin
Copy link
Contributor

No description provided.

@pull-request-size
Copy link

This PR is too big. Please break it up into smaller PRs.

Copy link
Contributor Author

@payetvin payetvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed mainly the code in src/solver/optimisation/

{
namespace // anonymous
{
static void toLower(std::string& str)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use boost::to_lower();

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}
}

bool readReservesAreaParameters(Area& area, const IniFile::Section& section)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move functions related to reserves in a new file src/libs/antares/study/area/reserves.cpp
list.cpp is too long already

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

namespace Antares::Data
{

void static errorIfNegativeValue(const std::string& propertyName,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used, remove or call it somewhere

Copy link
Collaborator

@sylvmara sylvmara Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed definition from header

std::pair<UnsuppliedSpilled, ReserveName> reserveParticipationUnsuppliedSpilledAt(
unsigned int index) const
{
int column = 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsigned int

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,28 @@
/*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe merge all the opt_.*reserves.h together ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

const int PremierPdtDeLIntervalle,
const int DernierPdtDeLIntervalle)
{
struct ReserveCostsInitializer
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of having this struct defined directly in the function instead of outside or in a header ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Struct now defined outside


void ReserveSatisfaction::add(int pays, int reserve, int pdt)
{
CAPACITY_RESERVATION& capacityReservation = data.areaReserves[pays]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

{
if (!data.Simulation)
{
// 24
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this mean ?

Copy link
Collaborator

@sylvmara sylvmara Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const, same for ohter loops below

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

int nbTermes = capacityReservation.AllThermalReservesParticipation.size()
+ capacityReservation.AllSTStorageReservesParticipation.size()
+ capacityReservation.AllHydroReservesParticipation.size();
if (nbTermes)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (nbTermes == 0)
    return;

There's no else, exit and avoid complexity

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@payetvin payetvin changed the base branch from develop to feature/reserve_model_lot3_scalian March 19, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants