Skip to content

Commit 4d64937

Browse files
committed
Handle not supported LimiReduction having a specific list of selected operational limits groups
Signed-off-by: CARON Alice <alice.caron@rte-france.com>
1 parent 5f28a6f commit 4d64937

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/main/java/com/powsybl/openloadflow/sa/LimitReductionManager.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ private static boolean isSupported(LimitReduction limitReduction) {
144144
LOGGER.warn("When two duration criteria are provided, they cannot be of the same type");
145145
return false;
146146
}
147+
if (!limitReduction.getOperationalLimitsGroupIdsSelection().isEmpty()) {
148+
LOGGER.warn("Limit reduction with only a specified operational limits groups to be applied on are not yet supported.");
149+
return false;
150+
}
151+
147152
return true;
148153
}
149154
}

src/test/java/com/powsybl/openloadflow/sa/LimitReductionManagerTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,17 @@ void twoDurationCriteriaOfSameTypeTest() {
236236
List<LimitReductionManager.TerminalLimitReduction> terminalLimitReductions = limitReductionManager.getTerminalLimitReductions();
237237
assertEquals(0, terminalLimitReductions.size());
238238
}
239+
240+
@Test
241+
void limitReductionsSpecifiedOperationalLimitsGroupNotSupportedTest() {
242+
String limitGroup1 = "limitGroup1";
243+
LimitReduction limitReduction = LimitReduction.builder(LimitType.CURRENT, 0.9)
244+
.withNetworkElementCriteria(new IdentifiableCriterion(
245+
new AtLeastOneNominalVoltageCriterion(VoltageInterval.between(220., 240., true, true))))
246+
.withLimitDurationCriteria(IntervalTemporaryDurationCriterion.between(0, 300, true, false))
247+
.withOperationalLimitsGroupIdSelection(limitGroup1)
248+
.build();
249+
LimitReductionManager limitReductionManager = LimitReductionManager.create(List.of(limitReduction));
250+
assertTrue(limitReductionManager.isEmpty());
251+
}
239252
}

0 commit comments

Comments
 (0)