本文整理了Java中com.powsybl.iidm.network.Network.getBranch()
方法的一些代码示例,展示了Network.getBranch()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.getBranch()
方法的具体详情如下:
包路径:com.powsybl.iidm.network.Network
类名称:Network
方法名:getBranch
[英]Get a branch
[中]得到一个分支
代码示例来源:origin: itesla/ipst
DtaParser.dumpAutomatonHeader(A56_AUTOMATA_ID, false, out);
losses.getLossOfSynchronismProtections().forEach(loss -> {
Branch branch = network.getBranch(loss.branch);
String eurostagId = iidm2eurostagId.get(loss.branch);
if (eurostagId == null) {
代码示例来源:origin: itesla/ipst
if (entry.getValue().size() == 1) {
String substationId = entry.getValue().iterator().next();
Branch branch = network.getBranch(branchId);
if (branch == null) {
throw new RuntimeException();
代码示例来源:origin: com.powsybl/powsybl-security-analysis-api
@Override
public void onPreContingencyResult(RunningContext context, LimitViolationsResult preContingencyResult) {
for (LimitViolation limitViolation : preContingencyResult.getLimitViolations()) {
if (limitViolation.getLimitType() == LimitViolationType.CURRENT) {
Branch branch = context.getNetwork().getBranch(limitViolation.getSubjectId());
double preContingencyValue = branch.getTerminal(limitViolation.getSide()).getP();
limitViolation.addExtension(ActivePowerExtension.class, new ActivePowerExtension(preContingencyValue));
}
}
}
代码示例来源:origin: com.powsybl/powsybl-cgmes-conversion
public OperationalLimitConversion(PropertyBag l, Conversion.Context context) {
super("OperationalLimitSet", l, context);
// Limit can associated to a Terminal or to an Equipment
terminalId = l.getId("Terminal");
if (terminalId != null) {
terminal = context.terminalMapping().find(terminalId);
}
equipmentId = l.getId("Equipment");
if (equipmentId != null) {
// The equipment may be a Branch, a Dangling line, a Switch ...
branch = context.network().getBranch(equipmentId);
if (branch == null) {
danglingLine = context.network().getDanglingLine(equipmentId);
if (danglingLine == null) {
aswitch = context.network().getSwitch(equipmentId);
}
}
}
}
代码示例来源:origin: itesla/ipst
private void setNewCurrentLimit(String stateId, LimitViolation violation, float margin, boolean applyToBaseCase) {
Branch branch = network.getBranch(violation.getSubjectId());
if (branch != null) {
double newLimit = getNewUpperLimit(violation, margin);
if (applyToBaseCase && !StateManagerConstants.INITIAL_STATE_ID.equals(stateId)) { // change the limit also to basecase
network.getStateManager().setWorkingState(StateManagerConstants.INITIAL_STATE_ID);
branch = network.getBranch(violation.getSubjectId());
LOGGER.debug("State {}: changing current limit 1 of branch {}: {} -> {}",
StateManagerConstants.INITIAL_STATE_ID,
if (applyToBaseCase && !StateManagerConstants.INITIAL_STATE_ID.equals(stateId)) { // change the limit also to basecase
network.getStateManager().setWorkingState(StateManagerConstants.INITIAL_STATE_ID);
branch = network.getBranch(violation.getSubjectId());
LOGGER.debug("State {}: changing current limit 2 of branch {}: {} -> {}",
StateManagerConstants.INITIAL_STATE_ID,
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
private Void readBranch(String[] tokens) {
int num = Integer.parseInt(tokens[1]);
int busNum = Integer.parseInt(tokens[2]);
int busNum2 = Integer.parseInt(tokens[3]);
double p1 = readDouble(tokens[4]);
double p2 = readDouble(tokens[5]);
double q1 = readDouble(tokens[6]);
double q2 = readDouble(tokens[7]);
String id = mapper.getId(AmplSubset.BRANCH, num);
Branch br = network.getBranch(id);
if (br != null) {
br.getTerminal1().setP(p1).setQ(q1);
br.getTerminal2().setP(p2).setQ(q2);
busConnection(br.getTerminal1(), busNum);
busConnection(br.getTerminal2(), busNum2);
return null;
}
if (readThreeWindingsTransformerBranch(id, p1, q1, busNum)) {
return null;
}
DanglingLine dl = network.getDanglingLine(id);
if (dl != null) {
dl.getTerminal().setP(p1).setQ(q1);
busConnection(dl.getTerminal(), busNum);
} else {
throw new AmplException("Invalid branch id '" + id + "'");
}
return null;
}
代码示例来源:origin: com.powsybl/powsybl-security-analysis-api
@Override
public void onPostContingencyResult(RunningContext context, PostContingencyResult postContingencyResult) {
String workingStateId = context.getNetwork().getVariantManager().getWorkingVariantId();
for (LimitViolation limitViolation : postContingencyResult.getLimitViolationsResult().getLimitViolations()) {
if (limitViolation.getLimitType() == LimitViolationType.CURRENT) {
Branch branch = context.getNetwork().getBranch(limitViolation.getSubjectId());
context.getNetwork().getVariantManager().setWorkingVariant(context.getInitialStateId());
limitViolation.addExtension(CurrentExtension.class, new CurrentExtension(branch.getTerminal(limitViolation.getSide()).getI()));
double preContingencyValue = branch.getTerminal(limitViolation.getSide()).getP();
context.getNetwork().getVariantManager().setWorkingVariant(workingStateId);
double postContingencyValue = branch.getTerminal(limitViolation.getSide()).getP();
limitViolation.addExtension(ActivePowerExtension.class, new ActivePowerExtension(preContingencyValue, postContingencyValue));
}
}
}
}
代码示例来源:origin: itesla/ipst
int sideNum = 0;
double nomV;
Branch branch = network.getBranch(attrId.getEquipmentId());
if (branch != null) {
entityType = 1;
内容来源于网络,如有侵权,请联系作者删除!