本文整理了Java中com.powsybl.iidm.network.Network.getDanglingLines()
方法的一些代码示例,展示了Network.getDanglingLines()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.getDanglingLines()
方法的具体详情如下:
包路径:com.powsybl.iidm.network.Network
类名称:Network
方法名:getDanglingLines
[英]Get all dangling lines.
[中]抓住所有悬垂的线。
代码示例来源:origin: itesla/ipst
public DataMiningFacadeParams(Network network, boolean generationSampled, boolean boundariesSampled, Interval interval) {
gensIds = new ArrayList<>();
if (generationSampled) {
for (Generator gen : network.getGenerators()) {
if (gen.getEnergySource().isIntermittent()) {
gensIds.add(gen.getId());
}
}
}
// it seems that elements order in iidm model is not the same
// after two subsequent network initialization from file
Collections.sort(gensIds);
loadsIds = new ArrayList<>();
for (Load load : network.getLoads()) {
loadsIds.add(load.getId());
}
Collections.sort(loadsIds);
danglingLinesIds = new ArrayList<>();
if (boundariesSampled) {
for (DanglingLine dl : network.getDanglingLines()) {
danglingLinesIds.add(dl.getId());
}
}
Collections.sort(danglingLinesIds);
countries = EnumSet.copyOf(network.getCountries());
this.interval = interval;
}
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
private void writeDanglingLineCurrentLimits(TableFormatter formatter) throws IOException {
for (DanglingLine dl : network.getDanglingLines()) {
String branchId = dl.getId();
if (dl.getCurrentLimits() != null) {
writeTemporaryCurrentLimits(dl.getCurrentLimits(), formatter, branchId, true, "");
}
}
}
代码示例来源:origin: com.powsybl/powsybl-iidm-impl
for (DanglingLine dl2 : Lists.newArrayList(other.getDanglingLines())) {
Map<String, DanglingLine> dl1byXnodeCode = new HashMap<>();
for (DanglingLine dl1 : getDanglingLines()) {
代码示例来源:origin: itesla/ipst
injections.add(sc);
for (DanglingLine dl : network.getDanglingLines()) {
injections.add(dl);
代码示例来源:origin: itesla/ipst
public void load(Network network, HistoDbClient histoDbClient) throws IOException, InterruptedException {
Set<HistoDbAttributeId> attributeIds = new LinkedHashSet<>();
for (Load l : network.getLoads()) {
if (l.getLoadType() != LoadType.FICTITIOUS) {
attributeIds.add(new HistoDbNetworkAttributeId(l.getId(), HistoDbAttr.P));
}
}
for (DanglingLine dl : network.getDanglingLines()) {
attributeIds.add(new HistoDbNetworkAttributeId(dl.getId(), HistoDbAttr.P0));
}
for (Generator g : network.getGenerators()) {
attributeIds.add(new HistoDbNetworkAttributeId(g.getId(), HistoDbAttr.P));
}
HistoDbStats stats = histoDbClient.queryStats(attributeIds, histoInterval, HistoDbHorizon.SN, true);
for (Load l : network.getLoads()) {
String id = l.getId();
loadLimits.put(id, range(id, HistoDbAttr.P, stats));
}
for (DanglingLine dl : network.getDanglingLines()) {
String id = dl.getId();
danglingLineLimits.put(id, range(id, HistoDbAttr.P0, stats));
}
for (Generator g : network.getGenerators()) {
String id = g.getId();
generatorLimits.put(id, range(id, HistoDbAttr.P, stats));
}
}
代码示例来源:origin: com.powsybl/powsybl-iidm-api
private static void addDanglingLines(Network network, ConnectedPower balanceMainCC, ConnectedPower balanceOtherCC) {
for (DanglingLine dl : network.getDanglingLines()) {
Terminal.BusBreakerView view = dl.getTerminal().getBusBreakerView();
if (view.getBus() != null) {
if (view.getBus().isInMainConnectedComponent()) {
balanceMainCC.connectedLoads.add(dl.getId());
balanceMainCC.connectedLoadVolume += dl.getP0();
} else {
balanceOtherCC.connectedLoads.add(dl.getId());
balanceOtherCC.connectedLoadVolume += dl.getP0();
}
} else {
if (view.getConnectableBus().isInMainConnectedComponent()) {
balanceMainCC.disconnectedLoads.add(dl.getId());
balanceMainCC.disconnectedLoadVolume += dl.getP0();
} else {
balanceOtherCC.disconnectedLoads.add(dl.getId());
balanceOtherCC.disconnectedLoadVolume += dl.getP0();
}
}
}
}
代码示例来源:origin: itesla/ipst
for (DanglingLine dl : network.getDanglingLines()) {
if (exportConfig.isExportMainCCOnly() && !EchUtil.isInMainCc(dl, exportConfig.isNoSwitch())) {
continue;
代码示例来源:origin: itesla/ipst
for (DanglingLine dl : Identifiables.sort(network.getDanglingLines())) {
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
private static void fillDanglingLines(StringToIntMapper<AmplSubset> mapper, Network network) {
for (DanglingLine dl : network.getDanglingLines()) {
mapper.newInt(AmplSubset.VOLTAGE_LEVEL, dl.getId());
mapper.newInt(AmplSubset.BUS, dl.getId());
mapper.newInt(AmplSubset.BRANCH, dl.getId());
mapper.newInt(AmplSubset.LOAD, dl.getId());
// limits
if (dl.getCurrentLimits() != null) {
createLimitsIds(mapper, dl.getCurrentLimits(), dl.getId(), "");
}
}
}
代码示例来源:origin: itesla/ipst
for (DanglingLine dl : Identifiables.sort(network.getDanglingLines())) {
if (onlyMainCC) {
Terminal t = dl.getTerminal();
代码示例来源:origin: itesla/ipst
Identifiables.sort(network.getDanglingLines()).forEach(dl -> {
busIds.add(EchUtil.getBusId(dl));
loadIds.add(EchUtil.getLoadId(dl));
NAMING_STRATEGY.fillDictionary(dictionary, EurostagNamingStrategy.NameType.VSC, converterStationsIds);
for (DanglingLine dl : Identifiables.sort(network.getDanglingLines())) {
代码示例来源:origin: itesla/ipst
private void createLoads(EsgNetwork esgNetwork) {
for (Load l : Identifiables.sort(network.getLoads())) {
// skip loads not in the main connected component
if (config.isExportMainCCOnly() && !EchUtil.isInMainCc(l, config.isNoSwitch())) {
LOGGER.warn("not in main component, skipping Load: {}", l.getId());
continue;
}
ConnectionBus bus = ConnectionBus.fromTerminal(l.getTerminal(), config, fakeNodes);
esgNetwork.addLoad(createLoad(bus, l.getId(), l.getP0(), l.getQ0()));
}
for (DanglingLine dl : Identifiables.sort(network.getDanglingLines())) {
// skip dls not in the main connected component
if (config.isExportMainCCOnly() && !EchUtil.isInMainCc(dl, config.isNoSwitch())) {
LOGGER.warn("not in main component, skipping DanglingLine: {}", dl.getId());
continue;
}
ConnectionBus bus = new ConnectionBus(true, EchUtil.getBusId(dl));
esgNetwork.addLoad(createLoad(bus, EchUtil.getLoadId(dl), dl.getP0(), dl.getQ0()));
}
}
代码示例来源:origin: itesla/ipst
public static void prepareBaseCase(Network network, OfflineWorkflowCreationParameters creationParameters,
HistoDbClient histoDbClient) throws IOException, InterruptedException {
clearSv(network);
// connect loads and intermittent generation and boundary lines (so everything that can be sampled)
for (Load l : network.getLoads()) {
l.getTerminal().connect();
}
if (creationParameters.isGenerationSampled()) {
for (Generator g : network.getGenerators()) {
if (g.getEnergySource().isIntermittent()) {
g.getTerminal().connect();
}
}
}
if (creationParameters.isBoundariesSampled()) {
for (DanglingLine dl : network.getDanglingLines()) {
dl.getTerminal().connect();
}
}
// TODO also override generator regulating status, phase shitfer regulating status and transformer regulating status?
// resize voltage limits with historical data
HistoDbUtil.fixVoltageLimits(network, histoDbClient, creationParameters.getHistoInterval());
// temporary workaround for Elia data, missing pmin, pmax
HistoDbUtil.fixGeneratorActiveLimits(network, histoDbClient, creationParameters.getHistoInterval());
}
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
private void writeDanglingLineMiddleBuses(AmplExportContext context, TableFormatter formatter) throws IOException {
for (DanglingLine dl : network.getDanglingLines()) {
Terminal t = dl.getTerminal();
Bus b = AmplUtil.getBus(dl.getTerminal());
int middleCcNum = getDanglingLineMiddleBusComponentNum(context, dl);
if (connectedComponentToExport(middleCcNum)) {
String middleBusId = getDanglingLineMiddleBusId(dl);
String middleVlId = getDanglingLineMiddleVoltageLevelId(dl);
context.busIdsToExport.add(middleBusId);
int middleBusNum = mapper.getInt(AmplSubset.BUS, middleBusId);
int middleVlNum = mapper.getInt(AmplSubset.VOLTAGE_LEVEL, middleVlId);
SV sv = new SV(t.getP(), t.getQ(), b != null ? b.getV() : Double.NaN, b != null ? b.getAngle() : Double.NaN).otherSide(dl);
double nomV = t.getVoltageLevel().getNominalV();
double v = sv.getU() / nomV;
double theta = Math.toRadians(sv.getA());
formatter.writeCell(variantIndex)
.writeCell(middleBusNum)
.writeCell(middleVlNum)
.writeCell(middleCcNum)
.writeCell(v)
.writeCell(theta)
.writeCell(0.0) // 0 MW injected at dangling line internal bus
.writeCell(0.0) // 0 MVar injected at dangling line internal bus
.writeCell(faultNum)
.writeCell(actionNum)
.writeCell(middleBusId);
}
}
}
代码示例来源:origin: itesla/ipst
for (DanglingLine dl : network.getDanglingLines()) {
boundariesP += dl.getP0();
boundariesQ += dl.getQ0();
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
addExtensions(num, l);
for (DanglingLine dl : network.getDanglingLines()) {
String middleBusId = getDanglingLineMiddleBusId(dl);
String id = dl.getId();
代码示例来源:origin: itesla/ipst
for (DanglingLine dl : Identifiables.sort(network.getDanglingLines())) {
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
private void writeDanglingLines(AmplExportContext context, TableFormatter formatter) throws IOException {
for (DanglingLine dl : network.getDanglingLines()) {
Terminal t = dl.getTerminal();
Bus bus1 = AmplUtil.getBus(t);
代码示例来源:origin: itesla/ipst
sc.getTerminal().setP(Float.NaN).setQ(Float.NaN);
for (DanglingLine dl : network.getDanglingLines()) {
dl.getTerminal().setP(Float.NaN).setQ(Float.NaN);
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
for (DanglingLine dl : network.getDanglingLines()) {
String vlId = getDanglingLineMiddleVoltageLevelId(dl);
int num = mapper.getInt(AmplSubset.VOLTAGE_LEVEL, vlId);
内容来源于网络,如有侵权,请联系作者删除!