Skip to content

Commit

Permalink
clean fix
Browse files Browse the repository at this point in the history
  • Loading branch information
h-fournier committed Dec 16, 2024
1 parent 764f35c commit 1de95dd
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 43 deletions.
24 changes: 12 additions & 12 deletions src/solver/optimisation/constraints/POutBounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ void POutBounds::add(int pays, int cluster, int pdt)
for (const auto& capacityReservation :
data.areaReserves[pays].areaCapacityReservationsDown)
{
for (const auto& [clusterId, reserveParticipations] :
capacityReservation.AllThermalReservesParticipation)
if (capacityReservation.AllThermalReservesParticipation.contains(cluster))
{
if (cluster == clusterId)
builder.RunningThermalClusterReserveParticipation(
reserveParticipations.globalIndexClusterParticipation,
1);
auto& reserveParticipation = capacityReservation.AllThermalReservesParticipation
.at(cluster);
builder.RunningThermalClusterReserveParticipation(
reserveParticipation.globalIndexClusterParticipation,
1);
}
}

Expand Down Expand Up @@ -60,13 +60,13 @@ void POutBounds::add(int pays, int cluster, int pdt)
for (const auto& capacityReservation :
data.areaReserves[pays].areaCapacityReservationsUp)
{
for (const auto& [clusterId, reserveParticipations] :
capacityReservation.AllThermalReservesParticipation)
if (capacityReservation.AllThermalReservesParticipation.contains(cluster))
{
if (cluster == clusterId)
builder.RunningThermalClusterReserveParticipation(
reserveParticipations.globalIndexClusterParticipation,
1);
auto& reserveParticipation = capacityReservation.AllThermalReservesParticipation
.at(cluster);
builder.RunningThermalClusterReserveParticipation(
reserveParticipation.globalIndexClusterParticipation,
1);
}
}

Expand Down
23 changes: 12 additions & 11 deletions src/solver/optimisation/constraints/POutCapacityThreasholds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ void POutCapacityThreasholds::add(int pays, int cluster, int pdt)
for (const auto& capacityReservation :
data.areaReserves[pays].areaCapacityReservationsDown)
{
for (const auto& [clusterId, reserveParticipations] :
capacityReservation.AllThermalReservesParticipation)
if (capacityReservation.AllThermalReservesParticipation.contains(cluster))
{
if (cluster == clusterId)
builder.RunningThermalClusterReserveParticipation(
reserveParticipations.globalIndexClusterParticipation, 1);
auto& reserveParticipation = capacityReservation.AllThermalReservesParticipation
.at(cluster);
builder.RunningThermalClusterReserveParticipation(
reserveParticipation.globalIndexClusterParticipation,
1);
}
}

Expand Down Expand Up @@ -59,13 +60,13 @@ void POutCapacityThreasholds::add(int pays, int cluster, int pdt)
for (const auto& capacityReservation :
data.areaReserves[pays].areaCapacityReservationsUp)
{
for (const auto& [clusterId, reserveParticipations] :
capacityReservation.AllThermalReservesParticipation)
if (capacityReservation.AllThermalReservesParticipation.contains(cluster))
{
if (cluster == clusterId)
builder.RunningThermalClusterReserveParticipation(
reserveParticipations.globalIndexClusterParticipation,
1);
auto& reserveParticipation = capacityReservation.AllThermalReservesParticipation
.at(cluster);
builder.RunningThermalClusterReserveParticipation(
reserveParticipation.globalIndexClusterParticipation,
1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ void STPumpingCapacityThreasholds::add(int pays, int cluster, int pdt)
for (const auto& capacityReservation :
data.areaReserves[pays].areaCapacityReservationsUp)
{
for (const auto& [clusterId, reserveParticipations] :
capacityReservation.AllSTStorageReservesParticipation)
if (capacityReservation.AllThermalReservesParticipation.contains(cluster))
{
if (cluster == clusterId)
builder.STStoragePumpingClusterReserveParticipation(
reserveParticipations.globalIndexClusterParticipation, 1);
auto& reserveParticipation = capacityReservation
.AllSTStorageReservesParticipation.at(cluster);
builder.STStoragePumpingClusterReserveParticipation(
reserveParticipation.globalIndexClusterParticipation,
1);
}
}

Expand All @@ -50,12 +51,13 @@ void STPumpingCapacityThreasholds::add(int pays, int cluster, int pdt)
for (const auto& capacityReservation :
data.areaReserves[pays].areaCapacityReservationsDown)
{
for (const auto& [clusterId, reserveParticipations] :
capacityReservation.AllSTStorageReservesParticipation)
if (capacityReservation.AllThermalReservesParticipation.contains(cluster))
{
if (cluster == clusterId)
builder.STStoragePumpingClusterReserveParticipation(
reserveParticipations.globalIndexClusterParticipation, 1);
auto& reserveParticipation = capacityReservation
.AllSTStorageReservesParticipation.at(cluster);
builder.STStoragePumpingClusterReserveParticipation(
reserveParticipation.globalIndexClusterParticipation,
1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ void STTurbiningCapacityThreasholds::add(int pays, int cluster, int pdt)
for (const auto& capacityReservation :
data.areaReserves[pays].areaCapacityReservationsDown)
{
for (const auto& [clusterId, reserveParticipations] :
capacityReservation.AllSTStorageReservesParticipation)
if (capacityReservation.AllThermalReservesParticipation.contains(cluster))
{
if (cluster == clusterId)
builder.STStorageTurbiningClusterReserveParticipation(
reserveParticipations.globalIndexClusterParticipation, -1);
auto& reserveParticipation = capacityReservation
.AllSTStorageReservesParticipation.at(cluster);
builder.STStorageTurbiningClusterReserveParticipation(
reserveParticipation.globalIndexClusterParticipation,
-1);
}
}

Expand Down Expand Up @@ -55,12 +56,13 @@ void STTurbiningCapacityThreasholds::add(int pays, int cluster, int pdt)
for (const auto& capacityReservation :
data.areaReserves[pays].areaCapacityReservationsUp)
{
for (const auto& [clusterId, reserveParticipations] :
capacityReservation.AllSTStorageReservesParticipation)
if (capacityReservation.AllThermalReservesParticipation.contains(cluster))
{
if (cluster == clusterId)
builder.STStorageTurbiningClusterReserveParticipation(
reserveParticipations.globalIndexClusterParticipation, 1);
auto& reserveParticipation = capacityReservation
.AllSTStorageReservesParticipation.at(cluster);
builder.STStorageTurbiningClusterReserveParticipation(
reserveParticipation.globalIndexClusterParticipation,
1);
}
}

Expand Down

0 comments on commit 1de95dd

Please sign in to comment.