Skip to content

Commit

Permalink
Remove branches (except TieLines) before connectables
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Dupuy <[email protected]>
  • Loading branch information
flo-dup committed Jan 21, 2025
1 parent 981d2e8 commit ff6a39c
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,18 @@ public void apply(Network network, NamingStrategy namingStrategy, boolean throwE
}
});

voltageLevel.getLines().forEach(line ->
new RemoveFeederBayBuilder().withConnectableId(line.getId()).build().apply(network, throwException, computationManager, reportNode));
voltageLevel.getTwoWindingsTransformers().forEach(transformer ->
new RemoveFeederBayBuilder().withConnectableId(transformer.getId()).build().apply(network, throwException, computationManager, reportNode));
voltageLevel.getThreeWindingsTransformers().forEach(transformer ->
new RemoveFeederBayBuilder().withConnectableId(transformer.getId()).build().apply(network, throwException, computationManager, reportNode));

voltageLevel.getConnectables().forEach(connectable -> {
if (connectable instanceof Injection) {
String connectableId = connectable.getId();
connectable.remove();
removedConnectableReport(reportNode, connectableId);
LOGGER.info("Connectable {} removed", connectableId);
} else {
new RemoveFeederBayBuilder().withConnectableId(connectable.getId()).build().apply(network, throwException, computationManager, reportNode);
}
String connectableId = connectable.getId();
connectable.remove();
removedConnectableReport(reportNode, connectableId);
LOGGER.info("Connectable {} removed", connectableId);
});

voltageLevel.remove();
Expand Down

0 comments on commit ff6a39c

Please sign in to comment.