Skip to content

Commit 93a9718

Browse files
committed
Merge branch 'main' into cleaning/refactor_leaf
2 parents 277fe0a + 7c99376 commit 93a9718

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons

ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private static UsageMethod getFinalUsageMethod(RemedialAction<?> remedialAction,
157157
private static Set<UsageMethod> getAllUsageMethods(Set<UsageRule> usageRules, RemedialAction<?> remedialAction, State state, FlowResult flowResult, Set<FlowCnec> flowCnecs, Network network, RaoParameters raoParameters) {
158158
return usageRules.stream()
159159
.filter(ur -> ur instanceof OnContingencyState || ur instanceof OnInstant
160-
|| (ur instanceof OnConstraint<?> || ur instanceof OnFlowConstraintInCountry)
160+
|| (ur instanceof OnFlowConstraintInCountry || ur instanceof OnConstraint<?> onConstraint && onConstraint.getCnec() instanceof FlowCnec)
161161
&& isAnyMarginNegative(flowResult, remedialAction.getFlowCnecsConstrainingForOneUsageRule(ur, flowCnecs, network), raoParameters.getObjectiveFunctionParameters().getType().getUnit()))
162162
.map(ur -> ur.getUsageMethod(state))
163163
.collect(Collectors.toSet());

0 commit comments

Comments
 (0)