com.powsybl.iidm.network.Terminal.getBusView()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中com.powsybl.iidm.network.Terminal.getBusView()方法的一些代码示例,展示了Terminal.getBusView()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Terminal.getBusView()方法的具体详情如下:
包路径:com.powsybl.iidm.network.Terminal
类名称:Terminal
方法名:getBusView

Terminal.getBusView介绍

[英]Get a view to access to bus topology informations at the terminal.
[中]查看终端的总线拓扑信息。

代码示例

代码示例来源:origin: com.powsybl/powsybl-ampl-converter

public static Bus getBus(Terminal t) {
  return t.getBusView().getBus();
}

代码示例来源:origin: com.powsybl/powsybl-ampl-converter

public static Bus getConnectableBus(Terminal t) {
  return t.getBusView().getConnectableBus();
}

代码示例来源:origin: com.powsybl/powsybl-iidm-api

private static boolean isMainComponent(LegBase<?> leg) {
  Bus bus = leg.getTerminal().getBusView().getBus();
  Bus connectableBus = leg.getTerminal().getBusView().getConnectableBus();
  boolean connectableMainComponent = connectableBus != null && connectableBus.isInMainConnectedComponent();
  return bus != null ? bus.isInMainConnectedComponent() : connectableMainComponent;
}

代码示例来源:origin: itesla/ipst

public Bus getBus(Terminal t, boolean noswitch) {
  if (noswitch) {
    return t.getBusView().getBus();
  } else {
    return t.getBusBreakerView().getBus();
  }
}

代码示例来源:origin: itesla/ipst

private void update(Terminal t) {
  if (t.getBusView().getBus() != null) {
    p = t.getP();
    q = t.getQ();
    v = t.getBusView().getBus().getV();
    i = t.getI();
  }
}

代码示例来源:origin: itesla/ipst

public static Bus getBus(Terminal t, boolean noswitch) {
  if (noswitch) {
    return t.getBusView().getBus();
  } else {
    return t.getBusBreakerView().getBus();
  }
}

代码示例来源:origin: com.powsybl/powsybl-action-util

private static void connectGenerator(Generator g) {
    Terminal t = g.getTerminal();
    t.connect();
    if (g.isVoltageRegulatorOn()) {
      Bus bus = t.getBusView().getBus();
      if (bus != null) {
        // set voltage setpoint to the same as other generators connected to the bus
        double targetV = bus.getGeneratorStream().findFirst().map(Generator::getTargetV).orElse(Double.NaN);
        // if no other generator connected to the bus, set voltage setpoint to network voltage
        if (Double.isNaN(targetV) && !Double.isNaN(bus.getV())) {
          g.setTargetV(bus.getV());
        }
      }
    }
    LOGGER.info("Connecting {}", g.getId());
  }
}

代码示例来源:origin: com.powsybl/powsybl-iidm-api

private static double getTheta(LegBase<?> leg) {
  return leg.getTerminal().isConnected() ? Math.toRadians(leg.getTerminal().getBusView().getBus().getAngle())
      : Double.NaN;
}

代码示例来源:origin: com.powsybl/powsybl-iidm-converter-api

public boolean test(Connectable<?> connectable) {
    if (buses == null) {
      return true;
    }
    for (Terminal t : connectable.getTerminals()) {
      Bus b = options.getTopologyLevel() == TopologyLevel.BUS_BRANCH ? t.getBusView().getConnectableBus() : t.getBusBreakerView().getConnectableBus();
      if (b != null && !buses.contains(b.getId())) {
        return false;
      }
    }
    return true;
  }
}

代码示例来源:origin: com.powsybl/powsybl-loadflow-results-completion

private void completeTerminalData(Terminal terminal, ThreeWindingsTransformer.Side side, TwtData twtData) {
  if (terminal.isConnected() && terminal.getBusView().getBus().isInMainConnectedComponent()) {
    if (Double.isNaN(terminal.getP())) {
      LOGGER.debug("Twt {}, Side {}: setting p = {}", twtData.getId(), side, twtData.getComputedP(side));
      terminal.setP(twtData.getComputedP(side));
    }
    if (Double.isNaN(terminal.getQ())) {
      LOGGER.debug("Twt {}, Side {}: setting q = {}", twtData.getId(), side, twtData.getComputedQ(side));
      terminal.setQ(twtData.getComputedQ(side));
    }
  }
}

代码示例来源:origin: com.powsybl/powsybl-loadflow-results-completion

private void completeTerminalData(Terminal terminal, Side side, BranchData branchData) {
  if (terminal.isConnected() && terminal.getBusView().getBus().isInMainConnectedComponent()) {
    if (Double.isNaN(terminal.getP())) {
      LOGGER.debug("Branch {}, Side {}: setting p = {}", branchData.getId(), side, branchData.getComputedP(side));
      terminal.setP(branchData.getComputedP(side));
    }
    if (Double.isNaN(terminal.getQ())) {
      LOGGER.debug("Branch {}, Side {}: setting q = {}", branchData.getId(), side, branchData.getComputedQ(side));
      terminal.setQ(branchData.getComputedQ(side));
    }
  }
}

代码示例来源:origin: itesla/ipst

@Override
  public void visitTerminal(Terminal t) {
    Connectable c = t.getConnectable();
    Bus b = t.getBusView().getBus();
    if (b == null) {
      if (c.getType() == ConnectableType.LOAD
          || c.getType() == ConnectableType.GENERATOR
          || c.getType() == ConnectableType.SHUNT_COMPENSATOR) {
        // add the injection in the topo set even if not connected but just connectable to this bus
        // see WP4.2 data mining topology spec for more detailed information
        b = t.getBusView().getConnectableBus();
      }
    }
    if (b != null) {
      topoTmp.put(b.getId(), c.getId());
    } else {
      // connect the equipment to its own bus
      topoTmp.put(c.getId() + "FICTIVE_BUS", c.getId());
    }
  }
});

代码示例来源:origin: com.powsybl/powsybl-iidm-api

private static double getV(LegBase<?> leg) {
  return leg.getTerminal().isConnected() ? leg.getTerminal().getBusView().getBus().getV() : Double.NaN;
}

代码示例来源:origin: itesla/ipst

public LoadRecord(Load load, ConnectBusInfo busInfo, double snref, SourceEngine sourceEngine) {
  this.load = load;
  this.busInfo = busInfo;
  this.loadId = load.getId();
  this.busConnected = busInfo.isConnected();
  this.p0 = this.load.getP0();
  this.q0 = this.load.getQ0();
  this.busVoltage = Double.NaN;
  this.busAngle = Double.NaN;
  this.sourceEngine = sourceEngine;
  if (this.busConnected) {
    if (load.getTerminal().getBusView().getBus() != null) {
      if (!Double.isNaN(load.getTerminal().getBusView().getBus().getV())) {
        busVoltage = load.getTerminal().getBusView().getBus().getV() / load.getTerminal().getVoltageLevel().getNominalV();
      }
      if (!Double.isNaN(load.getTerminal().getBusView().getBus().getAngle())) {
        busAngle = load.getTerminal().getBusView().getBus().getAngle();
      }
    }
    addLfParameters();
  } else {
    LOGGER.warn("Load " + this.getModelicaName() + " disconnected.");
    this.addValue(StaticData.COMMENT + " Load " + this.getModelicaName() + " disconnected.");
  }
  if (this.busVoltage == 0) {
    LOGGER.info("Voltage 0");
  }
}

代码示例来源:origin: com.powsybl/powsybl-iidm-converter-api

static void addBusOfOtherSideOfOpenBranches(Set<String> buses, Network n, ExportOptions options) {
  // and also bus at the other side of open branches
  n.getBranchStream().forEach(branch -> {
    Terminal t1 = branch.getTerminal1();
    Terminal t2 = branch.getTerminal2();
    if (options.getTopologyLevel() == TopologyLevel.BUS_BRANCH) {
      Bus b1 = t1.getBusView().getConnectableBus();
      Bus b2 = t2.getBusView().getConnectableBus();
      if ((b1 != null && b1.isInMainConnectedComponent()) && b2 != null && !b2.isInMainConnectedComponent()) {
        buses.add(b2.getId());
      } else if (b1 != null && !b1.isInMainConnectedComponent() && b2 != null && b2.isInMainConnectedComponent()) {
        buses.add(b1.getId());
      }
    } else {
      Bus b1 = t1.getBusBreakerView().getConnectableBus();
      Bus b2 = t2.getBusBreakerView().getConnectableBus();
      if (b1.isInMainConnectedComponent() && !b2.isInMainConnectedComponent()) {
        buses.add(b2.getId());
      } else if (!b1.isInMainConnectedComponent() && b2.isInMainConnectedComponent()) {
        buses.add(b1.getId());
      }
    }
  });
}

代码示例来源:origin: com.powsybl/powsybl-iidm-api

Bus b1 = branch.getTerminal1().getBusView().getBus();
Bus b2 = branch.getTerminal2().getBusView().getBus();
if (b1 != null && b2 != null) {
  Node n1 = nodes.get(getBusId(b1));

代码示例来源:origin: com.powsybl/powsybl-iidm-xml-converter

protected static void writeNodeOrBus(Integer index, Terminal t, NetworkXmlWriterContext context) throws XMLStreamException {
  TopologyLevel topologyLevel = TopologyLevel.min(t.getVoltageLevel().getTopologyKind(), context.getOptions().getTopologyLevel());
  switch (topologyLevel) {
    case NODE_BREAKER:
      writeNode(index, t, context);
      break;
    case BUS_BREAKER:
      writeBus(index, t.getBusBreakerView().getBus(), t.getBusBreakerView().getConnectableBus(), context);
      break;
    case BUS_BRANCH:
      writeBus(index, t.getBusView().getBus(), t.getBusView().getConnectableBus(), context);
      break;
    default:
      throw new AssertionError("Unexpected TopologyLevel value: " + topologyLevel);
  }
  if (index != null) {
    context.getWriter().writeAttribute("voltageLevelId" + index, context.getAnonymizer().anonymizeString(t.getVoltageLevel().getId()));
  }
}

代码示例来源:origin: com.powsybl/powsybl-iidm-api

Bus bus1 = twt.getTerminal1().getBusView().getBus();
Bus bus2 = twt.getTerminal2().getBusView().getBus();
Bus connectableBus1 = twt.getTerminal1().getBusView().getConnectableBus();
Bus connectableBus2 = twt.getTerminal2().getBusView().getConnectableBus();

代码示例来源:origin: com.powsybl/powsybl-iidm-xml-converter

@Override
protected BusbarSection readRootElementAttributes(BusbarSectionAdder adder, NetworkXmlReaderContext context) {
  int node = XmlUtil.readIntAttribute(context.getReader(), "node");
  double v = XmlUtil.readOptionalDoubleAttribute(context.getReader(), "v");
  double angle = XmlUtil.readOptionalDoubleAttribute(context.getReader(), "angle");
  BusbarSection bbs = adder.setNode(node)
      .add();
  context.getEndTasks().add(() -> {
    Bus b = bbs.getTerminal().getBusView().getBus();
    if (b != null) {
      b.setV(v).setAngle(angle);
    }
  });
  return bbs;
}

代码示例来源:origin: itesla/ipst

public static ConnectionBus fromTerminal(Terminal t, EurostagEchExportConfig config, EurostagFakeNodes fakeNodes) {
  if (config.isNoSwitch()) {
    Bus bus = t.getBusView().getBus();
    boolean connected;
    if (bus != null) {
    } else {
      connected = false;
      bus = t.getBusView().getConnectableBus();
      if (bus == null) {

相关文章