@Override public double getI() { if (connectable.getType() == ConnectableType.BUSBAR_SECTION) { return 0; } int variantIndex = network.get().getVariantIndex(); return Math.hypot(p.get(variantIndex), q.get(variantIndex)) / (Math.sqrt(3.) * getV() / 1000); }
protected boolean isBusValid(Set<ConfiguredBus> busSet) { int feederCount = 0; int branchCount = 0; for (TerminalExt terminal : FluentIterable.from(busSet).transformAndConcat(ConfiguredBus::getConnectedTerminals)) { AbstractConnectable connectable = terminal.getConnectable(); switch (connectable.getType()) { case LINE: case TWO_WINDINGS_TRANSFORMER: case THREE_WINDINGS_TRANSFORMER: case HVDC_CONVERTER_STATION: branchCount++; feederCount++; break; case DANGLING_LINE: case LOAD: case GENERATOR: case SHUNT_COMPENSATOR: case STATIC_VAR_COMPENSATOR: feederCount++; break; case BUSBAR_SECTION: // must not happend in a bus/breaker topology default: throw new AssertionError(); } } return Networks.isBusValid(branchCount); }
@Override public Terminal setP(double p) { if (connectable.getType() == ConnectableType.BUSBAR_SECTION) { throw new ValidationException(connectable, "cannot set active power on a busbar section"); } if (!Double.isNaN(p) && connectable.getType() == ConnectableType.SHUNT_COMPENSATOR) { throw new ValidationException(connectable, "cannot set active power on a shunt compensator"); } double oldValue = this.p.set(network.get().getVariantIndex(), p); getConnectable().notifyUpdate("p" + (num != -1 ? num : ""), oldValue, p); return this; }
for (TerminalExt terminal : bus.getTerminals()) { AbstractConnectable connectable = terminal.getConnectable(); label = connectable.getType().toString() + "\\n" + connectable.getId(); writer.append(" ").append(connectable.getId()) .append(" [label=\"").append(label).append("\"]\n");
for (TerminalExt terminal : getConnectedTerminals()) { AbstractConnectable connectable = terminal.getConnectable(); switch (connectable.getType()) { case BUSBAR_SECTION: case SHUNT_COMPENSATOR:
for (TerminalExt terminal : getConnectedTerminals()) { AbstractConnectable connectable = terminal.getConnectable(); switch (connectable.getType()) { case BUSBAR_SECTION: case LINE:
private void exportBuses(Graph g, Multimap<String, Integer> busToNodes, Map<Integer, Node> intToNode) { String[] colors = Colors.generateColorScale(busToNodes.asMap().keySet().size()); int i = 0; for (String key : busToNodes.asMap().keySet()) { Graph newBus = new Graph().id("\"" + key + "\""); newBus.attr(LABEL_ATTRIBUTE, key); for (int nodeInt : busToNodes.get(key)) { Node node = intToNode.get(nodeInt); TerminalExt terminal = graph.getVertexObject(nodeInt); if (terminal != null) { AbstractConnectable connectable = terminal.getConnectable(); String label = nodeInt + "\\n" + connectable.getType().toString() + "\\n" + connectable.getId(); node.attr(LABEL_ATTRIBUTE, label); } node.attr("style", "filled").attr("color", colors[i]); newBus.node(node); } g.subGraph(newBus); i++; } }
if (terminal != null) { AbstractConnectable connectable = terminal.getConnectable(); switch (connectable.getType()) { case LINE: case TWO_WINDINGS_TRANSFORMER:
@Override public Terminal setQ(double q) { if (connectable.getType() == ConnectableType.BUSBAR_SECTION) { throw new ValidationException(connectable, "cannot set reactive power on a busbar section"); } double oldValue = this.q.set(network.get().getVariantIndex(), q); getConnectable().notifyUpdate("q" + (num != -1 ? num : ""), oldValue, q); return this; }
public void exportTopology(OutputStream os) { Graph g = new Graph().id("\"" + NodeBreakerVoltageLevel.this.id + "\""); Map<Integer, Node> intToNode = new HashMap<>(); Multimap<String, Integer> busToNodes = ArrayListMultimap.create(); for (int n = 0; n < graph.getVertexCount(); n++) { Node node = new Node().id(Integer.toString(n)); intToNode.put(n, node); Bus bus = getCalculatedBusBreakerTopology().getBus(n); if (bus != null) { busToNodes.put(bus.getId(), n); } else { TerminalExt terminal = graph.getVertexObject(n); if (terminal != null) { AbstractConnectable connectable = terminal.getConnectable(); String label = n + "\\n" + connectable.getType().toString() + "\\n" + connectable.getId(); node.attr(LABEL_ATTRIBUTE, label); g.node(node); } } } exportBuses(g, busToNodes, intToNode); exportEdges(g, intToNode); g.writeTo(os); }
switch (connectable.getType()) { case BUSBAR_SECTION: visitor.visitBusbarSection((BusbarSectionImpl) connectable);