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