@Test public void runDummyComputation() { Network network = EurostagTutorialExample1Factory.create(); CandidateComputation computation = CandidateComputations.getComputation("dummy").orElseGet(failure()); assertNotNull(computation); assertEquals("dummy", computation.getName()); computation.run(network, null); assertEquals(126f, network.getGenerator("GEN").getTerminal().getP(), 0f); }
public static Optional<CandidateComputation> getComputation(String name) { return getComputations().stream().filter(c -> c.getName().equals(name)).findFirst(); }
CandidateComputations { public static Optional<CandidateComputation> getComputation(String name) { return getComputations().stream().filter(c -> c.getName().equals(name)).findFirst(); } }
CandidateComputations { public static Optional<CandidateComputation> getComputation(String name) { return getComputations().stream().filter(c -> c.getName().equals(name)).findFirst(); } private  CandidateComputations(); }
CandidateComputations { public static Optional<CandidateComputation> getComputation(String name) { return getComputations().stream().filter(c -> c.getName().equals(name)).findFirst(); } private  CandidateComputations(); static List<CandidateComputation> getComputations(); static List<String> getComputationsNames(); static Optional<CandidateComputation> getComputation(String name); }
CandidateComputations { public static Optional<CandidateComputation> getComputation(String name) { return getComputations().stream().filter(c -> c.getName().equals(name)).findFirst(); } private  CandidateComputations(); static List<CandidateComputation> getComputations(); static List<String> getComputationsNames(); static Optional<CandidateComputation> getComputation(String name);  }