Skip to content

Commit

Permalink
Make contingency order deterministic for sensitivity computation (#960)
Browse files Browse the repository at this point in the history
* use id to fix the order of contingencies in sensitivity computation

Signed-off-by: Philippe Edwards <[email protected]>
Signed-off-by: belthlemar <[email protected]>
  • Loading branch information
phiedw authored and MartinBelthle committed May 28, 2024
1 parent 7b50632 commit 13248b8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public Map<String, HvdcRangeAction> getHvdcs() {
@Override
public List<Contingency> getContingencies(Network network) {
//using a set to avoid duplicates
Set<Contingency> contingencies = new HashSet<>();
Set<Contingency> contingencies = new TreeSet<>(Comparator.comparing(Contingency::getId));
for (CnecSensitivityProvider cnecSensitivityProvider : cnecSensitivityProviders) {
contingencies.addAll(cnecSensitivityProvider.getContingencies(network));
}
Expand Down

0 comments on commit 13248b8

Please sign in to comment.