diff --git a/src/solver/optimisation/constraints/POutBounds.cpp b/src/solver/optimisation/constraints/POutBounds.cpp index ab57356a83..63612d899e 100644 --- a/src/solver/optimisation/constraints/POutBounds.cpp +++ b/src/solver/optimisation/constraints/POutBounds.cpp @@ -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); } } @@ -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); } } diff --git a/src/solver/optimisation/constraints/POutCapacityThreasholds.cpp b/src/solver/optimisation/constraints/POutCapacityThreasholds.cpp index c1c801f204..a72f5559d5 100644 --- a/src/solver/optimisation/constraints/POutCapacityThreasholds.cpp +++ b/src/solver/optimisation/constraints/POutCapacityThreasholds.cpp @@ -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); } } @@ -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); } } diff --git a/src/solver/optimisation/constraints/STPumpingCapacityThreasholds.cpp b/src/solver/optimisation/constraints/STPumpingCapacityThreasholds.cpp index 3fa9c27015..8d68410440 100644 --- a/src/solver/optimisation/constraints/STPumpingCapacityThreasholds.cpp +++ b/src/solver/optimisation/constraints/STPumpingCapacityThreasholds.cpp @@ -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); } } @@ -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); } } diff --git a/src/solver/optimisation/constraints/STTurbiningCapacityThreasholds.cpp b/src/solver/optimisation/constraints/STTurbiningCapacityThreasholds.cpp index 48227fa1b4..50c861a60b 100644 --- a/src/solver/optimisation/constraints/STTurbiningCapacityThreasholds.cpp +++ b/src/solver/optimisation/constraints/STTurbiningCapacityThreasholds.cpp @@ -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); } } @@ -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); } }