本文整理了Java中com.powsybl.iidm.network.Bus.getGenerators()
方法的一些代码示例,展示了Bus.getGenerators()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bus.getGenerators()
方法的具体详情如下:
包路径:com.powsybl.iidm.network.Bus
类名称: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();
内容来源于网络,如有侵权,请联系作者删除!