Skip to content

Commit

Permalink
merged switch
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
  • Loading branch information
rolnico committed Dec 20, 2023
1 parent 7258c98 commit e73fa5e
Showing 1 changed file with 5 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,30 +464,13 @@ public boolean isValid(UndirectedGraph<? extends TerminalExt, SwitchImpl> graph,
if (terminal != null) {
AbstractConnectable connectable = terminal.getConnectable();
switch (connectable.getType()) {
case LINE:
case TWO_WINDINGS_TRANSFORMER:
case THREE_WINDINGS_TRANSFORMER:
case HVDC_CONVERTER_STATION:
case DANGLING_LINE:
case LINE, TWO_WINDINGS_TRANSFORMER, THREE_WINDINGS_TRANSFORMER, HVDC_CONVERTER_STATION, DANGLING_LINE -> {
branchCount++;
feederCount++;
break;

case LOAD:
case GENERATOR:
case BATTERY:
case SHUNT_COMPENSATOR:
case STATIC_VAR_COMPENSATOR:
case GROUND:
feederCount++;
break;

case BUSBAR_SECTION:
busbarSectionCount++;
break;

default:
throw new IllegalStateException();
}
case LOAD, GENERATOR, BATTERY, SHUNT_COMPENSATOR, STATIC_VAR_COMPENSATOR, GROUND -> feederCount++;
case BUSBAR_SECTION -> busbarSectionCount++;
default -> throw new IllegalStateException();
}
}
}
Expand Down

0 comments on commit e73fa5e

Please sign in to comment.