com.powsybl.iidm.network.Network.getLine()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中com.powsybl.iidm.network.Network.getLine()方法的一些代码示例,展示了Network.getLine()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.getLine()方法的具体详情如下:
包路径:com.powsybl.iidm.network.Network
类名称:Network
方法名:getLine

Network.getLine介绍

[英]Get a AC line.
[中]接一条交流线路。

代码示例

代码示例来源:origin: itesla/ipst

private ContingencyElement getElement(Network network, Map<String, String> tieLines, String id) {
  if (network.getLine(id) != null) {
    return new BranchContingency(id);
  } else if (network.getGenerator(id) != null) {
    return new GeneratorContingency(id);
  } else if (tieLines.containsKey(id)) {
    return new BranchContingency(tieLines.get(id));
  } else {
    LOGGER.warn("Contingency element '{}' not found", id);
  }
  return null;
}

代码示例来源:origin: itesla/ipst

for (Equipment eq : cont.getEquipments().getEquipment()) {
  String id = eq.getId();
  if (network.getLine(id) != null) {
    LOGGER.info("contingency: {} - element BranchContingency, id: {}", contingency, id);
    elements.add(new BranchContingency(id));

代码示例来源:origin: itesla/ipst

for (LineOperation lo : ele.getLineOperation()) {
  String lineId = lo.getId();
  if (network.getLine(lineId) != null) {
    elements.add(new LineTrippingAction(lineId, lo.getImplementationTime(), lo.getAchievmentIndex()));
  } else if (tieLines.containsKey(lineId)) {

代码示例来源:origin: itesla/ipst

public Double getQ(String equipment) {
  logger.debug("  network " + network.getName() + " equipment: " + equipment);
  Double returnValue = null;
  EquipmentTypes     eqType = equipmentType(equipment);
  if (eqType != null) {
    switch (eqType) {
      case GEN:
        logger.debug(" equipment == generator");
        returnValue = network.getGenerator(equipment).getTerminal().getQ();
        break;
      case LOAD:
        logger.debug("  equipment == load");
        returnValue = network.getLoad(equipment).getQ0();
        break;
      case LINE:
        logger.debug("  equipment == line");
        if (network.getLine(equipment).getTerminal1() != null) {
          returnValue = network.getLine(equipment).getTerminal1().getQ();
        }
        if (network.getLine(equipment).getTerminal2() != null) {
          returnValue = network.getLine(equipment).getTerminal2().getQ();
        }
        break;
    }
  }
  if (returnValue != null) {
    logger.debug(" RETURN Q: " + returnValue + " for Network: " + network.getName() + " Equipment: " + equipment);
  }
  return  returnValue;
}

代码示例来源:origin: itesla/ipst

public Double getP(String equipment) {
  logger.debug("  network " + network.getName()  + " equipment: " + equipment);
  Double returnValue = null;
  EquipmentTypes     eqType = equipmentType(equipment);
  if (eqType != null) {
    switch (eqType) {
      case GEN:
        logger.debug("  equipment == generator");
        returnValue = network.getGenerator(equipment).getTerminal().getP();
        break;
      case LOAD:
        logger.debug("  equipment == load");
        returnValue = network.getLoad(equipment).getP0();
        break;
      case LINE:
        logger.debug(" equipment == line");
        if (network.getLine(equipment).getTerminal1() != null) {
          returnValue = network.getLine(equipment).getTerminal1().getP();
        }
        if (network.getLine(equipment).getTerminal2() != null) {
          returnValue = network.getLine(equipment).getTerminal2().getP();
        }
        break;
    }
  }
  if (returnValue != null) {
    logger.debug(" RETURN P: " + returnValue + " for Network: " + network.getName() + " Equipment: " + equipment);
  }
  return returnValue;
}

代码示例来源:origin: com.powsybl/powsybl-security-analysis-api

@Override
  public void modify(Network network, ComputationManager computationManager) {
    network.getLine("NHV1_NHV2_2").getTerminal1().disconnect();
    network.getLine("NHV1_NHV2_2").getTerminal2().disconnect();
    network.getLine("NHV1_NHV2_1").getTerminal2().setP(600.0);
  }
});

代码示例来源:origin: itesla/ipst

switch (element.getType()) {
  case BRANCH: {
    Line l = network.getLine(element.getId());
    if (l == null) {
      throw new RuntimeException("Line '" + element.getId() + "' not found");

代码示例来源:origin: itesla/ipst

public EquipmentTypes  equipmentType(String equipment) {
  if (network.getGenerator(equipment) != null) {
    return EquipmentTypes.GEN;
  }
  if (network.getLoad(equipment) != null) {
    return EquipmentTypes.LOAD;
  }
  if (network.getLine(equipment) != null) {
    return EquipmentTypes.LINE;
  }
  if (network.getTwoWindingsTransformer(equipment) != null) {
    return EquipmentTypes.TWOWINDTRASF;
  }
  if (network.getThreeWindingsTransformer(equipment) != null) {
    return EquipmentTypes.THREEWINDTRASF;
  }
  if (network.getVoltageLevel(equipment) != null) {
    return EquipmentTypes.VOLTAGELEVEL;
  }
  if (network.getShunt(equipment) != null) {
    return EquipmentTypes.SHUNT;
  }
  if (network.getSubstation(equipment) != null) {
    return EquipmentTypes.SUBSTATION;
  }
  logger.warn(" Type not found for equipment:" + equipment + " return NULL");
  return null;
}

代码示例来源:origin: com.powsybl/powsybl-security-analysis-api

@Test
//test current limit violation
public void checkCurrentLimits() {
  Line line = network.getLine("NHV1_NHV2_1");
  List<LimitViolation> violations = new ArrayList<>();
  LimitViolationDetector detector = new DefaultLimitViolationDetector(Collections.singleton(Security.CurrentLimitType.PATL));
  detector.checkCurrent(line, Branch.Side.TWO, 1101, violations::add);
  Assertions.assertThat(violations)
      .hasSize(1)
      .allSatisfy(l -> assertEquals(1100, l.getLimit(), 0d));
  violations = new ArrayList<>();
  detector = new DefaultLimitViolationDetector(Collections.singleton(Security.CurrentLimitType.TATL));
  detector.checkCurrent(line, Branch.Side.TWO, 1201, violations::add);
  Assertions.assertThat(violations)
      .hasSize(1)
      .allSatisfy(l -> assertEquals(1200, l.getLimit(), 0d));
}

代码示例来源:origin: itesla/ipst

VoltageLevel v1 = network.getLine(equipment).getTerminal1().getVoltageLevel();
if (v1.getSubstation().getTso() != null) {
  tsos.add(v1.getSubstation().getTso());
VoltageLevel v2 = network.getLine(equipment).getTerminal2().getVoltageLevel();
if (v2.getSubstation().getTso() != null) {
  tsos.add(v2.getSubstation().getTso());

代码示例来源:origin: com.powsybl/powsybl-security-analysis-api

((Bus) network.getIdentifiable("NHV1")).setV(380.0);
((Bus) network.getIdentifiable("NHV2")).setV(380.0);
network.getLine("NHV1_NHV2_1").getTerminal1().setP(560.0).setQ(550.0);
network.getLine("NHV1_NHV2_1").getTerminal2().setP(560.0).setQ(550.0);
network.getLine("NHV1_NHV2_1").newCurrentLimits1().setPermanentLimit(1500.0).add();
network.getLine("NHV1_NHV2_1").newCurrentLimits2()
  .setPermanentLimit(1200.0)
  .beginTemporaryLimit()

代码示例来源:origin: com.powsybl/powsybl-iidm-test

((Bus) network.getIdentifiable("NHV2")).setV(380).getVoltageLevel().setLowVoltageLimit(300).setHighVoltageLimit(500);
Line line = network.getLine("NHV1_NHV2_1");
line.getTerminal1().setP(560.0).setQ(550.0);
line.getTerminal2().setP(560.0).setQ(550.0);
  .add();
line = network.getLine("NHV1_NHV2_2");
line.getTerminal1().setP(560.0).setQ(550.0);
line.getTerminal2().setP(560.0).setQ(550.0);

代码示例来源:origin: com.powsybl/powsybl-cgmes-conformity

.add();
Line lineBE2 = network.getLine("_b58bf21a-096a-4dae-9a01-3f03b60c24c7");
lineBE2.getCurrentLimits1().setPermanentLimit(2000.0);
lineBE2.getCurrentLimits2().setPermanentLimit(2000.0);

相关文章