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

x33g5p2x  于2022-01-16 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(102)

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

Bus.getGeneratorStream介绍

[英]Get generators connected to the bus.
[中]把发电机连接到公共汽车上。

代码示例

代码示例来源: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

for (Bus b : network.getBusView().getBuses()) {
  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()

相关文章