@Test public void testFailure() { thrown.expect(PowsyblException.class); thrown.expectMessage("The active power of 'NHV1_NHV2_1' (VLHV1) is not set. Do you forget to compute the flows?"); Network network = EurostagTutorialExample1Factory.create(); NetworkReducer reducer = NetworkReducer.builder() .withNetworkPredicate(IdentifierNetworkPredicate.of("P1")) .build(); reducer.reduce(network); }
@Override protected void reduce(Substation substation) { substation.remove(); observers.forEach(o -> o.substationRemoved(substation)); }
DefaultNetworkReducer extends AbstractNetworkReducer { @Override protected void reduce(Substation substation) { substation.remove(); observers.forEach(o -> o.substationRemoved(substation)); } }
DefaultNetworkReducer extends AbstractNetworkReducer { @Override protected void reduce(Substation substation) { substation.remove(); observers.forEach(o -> o.substationRemoved(substation)); } DefaultNetworkReducer(NetworkPredicate predicate, ReductionOptions options);  DefaultNetworkReducer(NetworkPredicate predicate, ReductionOptions options, NetworkReducerObserver... observers);  DefaultNetworkReducer(NetworkPredicate predicate, ReductionOptions options, List<NetworkReducerObserver> observers); }
DefaultNetworkReducer extends AbstractNetworkReducer { @Override protected void reduce(Substation substation) { substation.remove(); observers.forEach(o -> o.substationRemoved(substation)); } DefaultNetworkReducer(NetworkPredicate predicate, ReductionOptions options);  DefaultNetworkReducer(NetworkPredicate predicate, ReductionOptions options, NetworkReducerObserver... observers);  DefaultNetworkReducer(NetworkPredicate predicate, ReductionOptions options, List<NetworkReducerObserver> observers);  }
DefaultNetworkReducer extends AbstractNetworkReducer { @Override protected void reduce(Substation substation) { substation.remove(); observers.forEach(o -> o.substationRemoved(substation)); } DefaultNetworkReducer(NetworkPredicate predicate, ReductionOptions options);  DefaultNetworkReducer(NetworkPredicate predicate, ReductionOptions options, NetworkReducerObserver... observers);  DefaultNetworkReducer(NetworkPredicate predicate, ReductionOptions options, List<NetworkReducerObserver> observers);   }