public void write(Path file) throws IOException { try (OutputStream os = Files.newOutputStream(file)) { write(os); } }
long load = Math.round(b.getLoadStream().mapToDouble(Load::getP0).sum()); long maxGeneration = Math.round(b.getGeneratorStream().mapToDouble(Generator::getMaxP).sum()); String busId = getBusId(b); Node n = new Node() .id(busId) Bus b2 = branch.getTerminal2().getBusView().getBus(); if (b1 != null && b2 != null) { Node n1 = nodes.get(getBusId(b1)); Node n2 = nodes.get(getBusId(b2)); graph.edge(new Edge(n1, n2).attr("tooltip", branch.getName()));