Skip to content

Commit

Permalink
Merge pull request #176 from farao-community/remove-mnec-from-prevent…
Browse files Browse the repository at this point in the history
…ive-cnecs

remove mnec from preventive cnecs
  • Loading branch information
danielthirion authored Feb 12, 2024
2 parents 31fb8be + 89f5bfd commit f634fa2
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,18 @@ private static List<Action> getCurativeActions(String contingencyId, CracResults
private static List<PreventiveBranchResult> getPreventiveBranchResults(CracResultsHelper cracResultsHelper) {
List<PreventiveBranchResult> preventiveBranchResults = new ArrayList<>();
List<CnecPreventive> preventiveCnecs = cracResultsHelper.getPreventiveCnecs();
preventiveCnecs.forEach(cnecPrev -> {
PreventiveBranchResult preventiveBranchResult = new PreventiveBranchResult();
preventiveBranchResult.setName(cnecPrev.getCnecCommon().getName());
fillBranchCommonPropertiesFromCnecCommon(cnecPrev.getCnecCommon(), preventiveBranchResult);

preventiveBranchResult.setIMax(getIValue((int) cnecPrev.getiMax()));
preventiveBranchResult.setIBeforeOptimization(getIValue((int) cnecPrev.getiBeforeOptimisation()));
preventiveBranchResult.setIAfterOptimization(getIValue((int) cnecPrev.getI()));
preventiveBranchResults.add(preventiveBranchResult);
});
preventiveCnecs.stream()
.filter(mergedCnec -> !mergedCnec.getCnecCommon().isMonitored())
.forEach(cnecPrev -> {
PreventiveBranchResult preventiveBranchResult = new PreventiveBranchResult();
preventiveBranchResult.setName(cnecPrev.getCnecCommon().getName());
fillBranchCommonPropertiesFromCnecCommon(cnecPrev.getCnecCommon(), preventiveBranchResult);

preventiveBranchResult.setIMax(getIValue((int) cnecPrev.getiMax()));
preventiveBranchResult.setIBeforeOptimization(getIValue((int) cnecPrev.getiBeforeOptimisation()));
preventiveBranchResult.setIAfterOptimization(getIValue((int) cnecPrev.getI()));
preventiveBranchResults.add(preventiveBranchResult);
});
return preventiveBranchResults;
}

Expand Down

0 comments on commit f634fa2

Please sign in to comment.