本文整理了Java中com.powsybl.iidm.network.Network.getLines()
方法的一些代码示例,展示了Network.getLines()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.getLines()
方法的具体详情如下:
包路径:com.powsybl.iidm.network.Network
类名称:Network
方法名:getLines
[英]Get all AC lines.
[中]接通所有的交流线路。
代码示例来源:origin: itesla/ipst
@Override
public List<Contingency> getContingencies(Network network) {
List<Contingency> contingencies = new ArrayList<>(lineContigencyCount);
for (Line l : Iterables.limit(network.getLines(), lineContigencyCount)) {
contingencies.add(new Contingency(l.getId(), Arrays.<ContingencyElement>asList(new BranchContingency(l.getId()))));
}
return contingencies;
}
代码示例来源:origin: itesla/ipst
@Override
public List<Contingency> getContingencies(Network network) {
Map<String, String> tieLines = new HashMap<>();
for (Line l : network.getLines()) {
if (l.isTieLine()) {
TieLine tl = (TieLine) l;
tieLines.put(tl.getHalf1().getId(), tl.getId());
tieLines.put(tl.getHalf2().getId(), tl.getId());
}
}
List<Contingency> contingencies = new ArrayList<>();
contingency_data.forEach(cd -> {
List<ContingencyElement> elements = cd.getElementsIds().stream()
.map(id -> getElement(network, tieLines, id))
.filter(Objects::nonNull)
.collect(Collectors.toList());
if (elements.size() > 0) {
contingencies.add(new Contingency(cd.getId(), elements));
} else {
LOGGER.warn("Skip empty contingency " + cd.getId());
}
});
return contingencies;
}
代码示例来源:origin: itesla/ipst
System.out.println("Lines = " + Identifiables.sort(_network.getLines()).size());
代码示例来源:origin: itesla/ipst
private void mergeDanglingLines(Network network) {
for (Line l : network.getLines()) {
if (l.isTieLine()) {
TieLine tieLine = (TieLine) l;
代码示例来源:origin: itesla/ipst
for (Line l : network.getLines()) {
if (l.isTieLine()) {
TieLine tl = (TieLine) l;
代码示例来源:origin: itesla/ipst
LOGGER.info("# Name From To From To ");
LOGGER.info("#------------------------ --------------- --------------- --------------- --------------- ");
for (Line line : network.getLines()) {
LOGGER.info(String.format("%s %15.8f %15.8f %15.8f %15.8f", line.getId(), line.getTerminal1().getQ(), line.getTerminal2().getQ(), line.getTerminal1().getP(), line.getTerminal2().getP()));
代码示例来源:origin: itesla/ipst
for (Line l : network.getLines()) {
branches.add(l);
代码示例来源:origin: itesla/ipst
public static BranchParallelIndexes build(Network network, EurostagEchExportConfig config, EurostagFakeNodes fakeNodes) {
Multimap<String, Identifiable> map = HashMultimap.create();
for (Branch branch : Iterables.concat(network.getLines(), network.getTwoWindingsTransformers())) {
ConnectionBus bus1 = ConnectionBus.fromTerminal(branch.getTerminal1(), config, fakeNodes);
ConnectionBus bus2 = ConnectionBus.fromTerminal(branch.getTerminal2(), config, fakeNodes);
代码示例来源:origin: com.powsybl/powsybl-iidm-xml-converter
SubstationXml.INSTANCE.write(s, null, context);
for (Line l : n.getLines()) {
if (!filter.test(l)) {
continue;
代码示例来源:origin: itesla/ipst
for (Line l : network.getLines()) {
if (exportConfig.isExportMainCCOnly() && !EchUtil.isInMainCc(l, exportConfig.isNoSwitch())) {
continue;
代码示例来源:origin: itesla/ipst
for (Line l : network.getLines()) {
if (l.isTieLine()) {
TieLine tl = (TieLine) l;
代码示例来源:origin: itesla/ipst
for (Line l : network.getLines()) {
if (l.isTieLine()) {
TieLine tl = (TieLine) l;
代码示例来源:origin: itesla/ipst
for (Line l : Identifiables.sort(network.getLines())) {
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
private void writeTieLineMiddleBuses(AmplExportContext context, TableFormatter formatter) throws IOException {
for (Line l : network.getLines()) {
if (!l.isTieLine()) {
continue;
}
TieLine tieLine = (TieLine) l;
int xNodeCcNum = getTieLineMiddleBusComponentNum(context, tieLine);
if (connectedComponentToExport(xNodeCcNum)) {
String xNodeBusId = AmplUtil.getXnodeBusId(tieLine);
int xNodeBusNum = mapper.getInt(AmplSubset.BUS, xNodeBusId);
int xNodeVlNum = mapper.getInt(AmplSubset.VOLTAGE_LEVEL, AmplUtil.getXnodeVoltageLevelId(tieLine));
formatter.writeCell(variantIndex)
.writeCell(xNodeBusNum)
.writeCell(xNodeVlNum)
.writeCell(xNodeCcNum)
.writeCell(Float.NaN)
.writeCell(Double.NaN)
.writeCell(0.0)
.writeCell(0.0)
.writeCell(faultNum)
.writeCell(actionNum)
.writeCell(xNodeBusId);
}
}
}
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
private static void fillLines(StringToIntMapper<AmplSubset> mapper, Network network) {
for (Line l : network.getLines()) {
mapper.newInt(AmplSubset.BRANCH, l.getId());
if (l.isTieLine()) {
TieLine tl = (TieLine) l;
mapper.newInt(AmplSubset.VOLTAGE_LEVEL, AmplUtil.getXnodeVoltageLevelId(tl));
mapper.newInt(AmplSubset.BUS, AmplUtil.getXnodeBusId(tl));
mapper.newInt(AmplSubset.BRANCH, tl.getHalf1().getId());
mapper.newInt(AmplSubset.BRANCH, tl.getHalf2().getId());
}
// limits
if (l.getCurrentLimits1() != null) {
createLimitsIds(mapper, l.getCurrentLimits1(), l.getId(), "_1_");
}
if (l.getCurrentLimits2() != null) {
createLimitsIds(mapper, l.getCurrentLimits2(), l.getId(), "_2_");
}
}
}
代码示例来源:origin: itesla/ipst
private void createLines(EsgNetwork esgNetwork, EsgGeneralParameters parameters) {
for (Line l : Identifiables.sort(network.getLines())) {
代码示例来源:origin: itesla/ipst
private static void extractLinesData(Network network, NetworkData networkData) {
for (Line line : network.getLines()) {
if (line.getTerminal1().getVoltageLevel().getNominalV() >= 110) {
networkData.addLineData(new LineData(line.getId(),
(line.getTerminal1().getBusBreakerView().getBus() != null)
? line.getTerminal1().getBusBreakerView().getBus().getId()
: line.getTerminal1().getBusBreakerView().getConnectableBus().getId(),
(line.getTerminal2().getBusBreakerView().getBus() != null)
? line.getTerminal2().getBusBreakerView().getBus().getId()
: line.getTerminal2().getBusBreakerView().getConnectableBus().getId(),
line.getTerminal1().getI(),
line.getTerminal2().getI(),
(line.getCurrentLimits1() != null) ? line.getCurrentLimits1().getPermanentLimit() : Float.NaN,
(line.getCurrentLimits2() != null) ? line.getCurrentLimits2().getPermanentLimit() : Float.NaN)
);
}
}
}
代码示例来源:origin: itesla/ipst
dl.getTerminal().setP(Float.NaN).setQ(Float.NaN);
for (Line l : network.getLines()) {
l.getTerminal1().setP(Float.NaN).setQ(Float.NaN);
l.getTerminal2().setP(Float.NaN).setQ(Float.NaN);
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
private void writeLines(AmplExportContext context, TableFormatter formatter) throws IOException {
for (Line l : network.getLines()) {
Terminal t1 = l.getTerminal1();
Terminal t2 = l.getTerminal2();
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
for (Line l : network.getLines()) {
if (!l.isTieLine()) {
continue;
内容来源于网络,如有侵权,请联系作者删除!