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

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

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

Bus.getGenerators介绍

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

代码示例

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

public static int getBusType(Bus bus) {
    Objects.requireNonNull(bus, "bus is null");
    int type = BusData.BUS_TYPE_PQ; // a connection bus is PQ
    if (bus.getGenerators() != null) {
      for (Generator generator : bus.getGenerators()) {
        if (generator.isVoltageRegulatorOn()) {
          type = BusData.BUS_TYPE_PV; // a bus with attached a generator with voltage regulator on is PV
          break;
        }
      }
    }
//        if ( bus.getLoads() != null && bus.getLoads().iterator().hasNext() && type == 3 )
//            type = MCSBusData.BUS_TYPE_PV; // a bus with attached both loads and generators is anyway a PV
    return type;
  }

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

List<Double> generatorsReactivePower = new ArrayList<>();
bus.getGenerators().forEach((generator) -> {
  generators.add(generator.getId());
  generatorsActivePower.add(generator.getTerminal().getP());
                  bus.getV(),
                  bus.getAngle(),
                  bus.getGenerators().iterator().hasNext(),
                  generators,
                  activeInjection,

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

protected void updateSlackBusData(Bus bus, Integer busIndex, SlackBusData slackBusData) {
  if (bus.getGenerators() == null) {
    return;
  }
  //...slackbus has at least one generator connected
  for (Generator generator : bus.getGenerators()) {
    //...which has a generator with voltage regulator on
    if (!generator.isVoltageRegulatorOn()) {
      continue;
    }
    //...assure the generator is the one connected to the bus (and not on the aggregated buses)
    if (!generator.getTerminal().getBusBreakerView().getBus().getId().equals(bus.getId())) {
      return;
    }
    //...candidate slackbus
    if (slackBusData.getSlackBusIndex() == -1) {
      slackBusData.setSlackBusIndex(busIndex);
      slackBusData.setSlackBusGenerator(generator);
      return;
    }
    //...choice the generator with the largest TargetP
    if (generator.getTargetP() > slackBusData.getSlackBusGenerator().getTargetP()) {
      slackBusData.setSlackBusIndex(busIndex);
      slackBusData.setSlackBusGenerator(generator);
    }
  }
}

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

private static void updateSlackBusData(Bus bus, Integer busIndex, SlackBusData slackBusData) {
  if (bus.getGenerators() == null) {
    return;
  }
  //...slackbus has at least one generator connected
  for (Generator generator : bus.getGenerators()) {
    //...which has a generator with voltage regulator on
    if (!generator.isVoltageRegulatorOn()) {
      continue;
    }
    //...assure the generator is the one connected to the bus (and not on the aggregated buses)
    if (!generator.getTerminal().getBusBreakerView().getBus().getId().equals(bus.getId())) {
      return;
    }
    //...candidate slackbus
    if (slackBusData.getSlackBusIndex() == -1) {
      slackBusData.setSlackBusIndex(busIndex);
      slackBusData.setSlackBusGenerator(generator);
      return;
    }
    //...choice the generator with the largest TargetP
    if (generator.getTargetP() > slackBusData.getSlackBusGenerator().getTargetP()) {
      slackBusData.setSlackBusIndex(busIndex);
      slackBusData.setSlackBusGenerator(generator);
    }
  }
}

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

Iterator<Generator> itrG = b.getGenerators().iterator();
while (itrG.hasNext()) {
  Generator gen = itrG.next();

相关文章