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

x33g5p2x  于2022-01-24 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(97)

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

Network.getVoltageLevelStream介绍

[英]Get all substation voltage levels.
[中]获取所有变电站电压水平。

代码示例

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

private int removeBreakers(Network network) {
  AtomicInteger removedSwitches = new AtomicInteger(0);
  network.getVoltageLevelStream().forEach(vl -> {
    int removed = removeBreakers(network, vl);
    removedSwitches.addAndGet(removed);
    while (removed > 0) {
      removed = removeBreakers(network, vl);
      removedSwitches.addAndGet(removed);
    }
    removed = removeDoubleSwitchBuses(network, vl);
    removedSwitches.addAndGet(removed);
    while (removed > 0) {
      removed = removeDoubleSwitchBuses(network, vl);
      removedSwitches.addAndGet(removed);
    }
  });
  LOGGER.info("Removed switches: " + removedSwitches.get());
  return removedSwitches.get();
}

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

@Override
public void checkAll(Network network, Consumer<LimitViolation> consumer) {
  network.getBranchStream().forEach(b -> checkCurrent(b, consumer));
  network.getVoltageLevelStream()
      .flatMap(v -> v.getBusView().getBusStream())
      .forEach(b -> checkVoltage(b, consumer));
}

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

List<VoltageLevel> voltageLevels = network.getVoltageLevelStream()
    .filter(vl -> !test(vl))
    .collect(Collectors.toList());

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

public static void fillMapper(StringToIntMapper<AmplSubset> mapper, Network network) {
  // Voltage levels
  network.getVoltageLevelStream().forEach(vl -> mapper.newInt(AmplSubset.VOLTAGE_LEVEL, vl.getId()));
  // Buses
  getBuses(network).forEach(b -> mapper.newInt(AmplSubset.BUS, b.getId()));
  // Lines
  fillLines(mapper, network);
  // Two windings transformers
  fillTwoWindingsTransformers(mapper, network);
  // Three windings transformers
  fillThreeWindingsTransformers(mapper, network);
  // Dangling lines
  fillDanglingLines(mapper, network);
  // loads
  network.getLoadStream().forEach(l -> mapper.newInt(AmplSubset.LOAD, l.getId()));
  // shunts
  network.getShuntCompensatorStream().forEach(sc -> mapper.newInt(AmplSubset.SHUNT, sc.getId()));
  // generators
  network.getGeneratorStream().forEach(g -> mapper.newInt(AmplSubset.GENERATOR, g.getId()));
  // static var compensators
  network.getStaticVarCompensatorStream().forEach(svc -> mapper.newInt(AmplSubset.STATIC_VAR_COMPENSATOR, svc.getId()));
  // HVDC lines
  network.getHvdcLineStream().forEach(hvdc -> mapper.newInt(AmplSubset.HVDC_LINE, hvdc.getId()));
  // HvdcConverterStations
  network.getHvdcConverterStations().forEach(conv ->
      mapper.newInt(conv.getHvdcType().equals(HvdcType.VSC) ? AmplSubset.VSC_CONVERTER_STATION : AmplSubset.LCC_CONVERTER_STATION,  conv.getId()));
}

相关文章