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

x33g5p2x  于2022-01-30 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(84)

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

Terminal.getConnectable介绍

[英]Get the equipment that is connected to the terminal.
[中]获取连接到终端的设备。

代码示例

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

private static boolean isBusbarSection(Terminal t) {
  return t != null && t.getConnectable().getType() == ConnectableType.BUSBAR_SECTION;
}

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

private static double checkP(Terminal terminal) {
  if (!terminal.isConnected()) {
    return 0.0;
  }
  if (Double.isNaN(terminal.getP())) {
    String connectableId = terminal.getConnectable().getId();
    String voltageLevelId = terminal.getVoltageLevel().getId();
    throw new PowsyblException("The active power of '" + connectableId + "' (" + voltageLevelId + ") is not set. Do you forget to compute the flows?");
  }
  return terminal.getP();
}

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

private static double checkQ(Terminal terminal) {
    if (!terminal.isConnected()) {
      return 0.0;
    }
    if (Double.isNaN(terminal.getQ())) {
      String connectableId = terminal.getConnectable().getId();
      String voltageLevelId = terminal.getVoltageLevel().getId();
      throw new PowsyblException("The reactive power of '" + connectableId + "' (" + voltageLevelId + ") is not set. Do you forget to compute the flows?");
    }
    return terminal.getQ();
  }
}

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

protected static void writeTerminalRef(Terminal t, NetworkXmlWriterContext context, String elementName) throws XMLStreamException {
  Connectable c = t.getConnectable();
  if (!context.getFilter().test(c)) {
    throw new PowsyblException("Oups, terminal ref point to a filtered equipment " + c.getId());
  }
  context.getWriter().writeEmptyElement(IIDM_URI, elementName);
  context.getWriter().writeAttribute("id", context.getAnonymizer().anonymizeString(c.getId()));
  if (c.getTerminals().size() > 1) {
    if (c instanceof Injection) {
      // nothing to do
    } else if (c instanceof Branch) {
      Branch branch = (Branch) c;
      context.getWriter().writeAttribute("side", branch.getSide(t).name());
    } else if (c instanceof ThreeWindingsTransformer) {
      ThreeWindingsTransformer twt = (ThreeWindingsTransformer) c;
      context.getWriter().writeAttribute("side", twt.getSide(t).name());
    } else {
      throw new AssertionError("Unexpected Connectable instance: " + c.getClass());
    }
  }
}

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

@Override
  public void visitTerminal(Terminal t) {
    Connectable c = t.getConnectable();
    Bus b = t.getBusView().getBus();
    if (b == null) {
      if (c.getType() == ConnectableType.LOAD
          || c.getType() == ConnectableType.GENERATOR
          || c.getType() == ConnectableType.SHUNT_COMPENSATOR) {
        // add the injection in the topo set even if not connected but just connectable to this bus
        // see WP4.2 data mining topology spec for more detailed information
        b = t.getBusView().getConnectableBus();
      }
    }
    if (b != null) {
      topoTmp.put(b.getId(), c.getId());
    } else {
      // connect the equipment to its own bus
      topoTmp.put(c.getId() + "FICTIVE_BUS", c.getId());
    }
  }
});

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

private PropertyBag createPowerFlowProperties(CgmesModel cgmes, Terminal terminal) {
  PropertyBag p = new PropertyBag(SV_POWERFLOW_PROPERTIES);
  p.put("p", fs(terminal.getP()));
  p.put("q", fs(terminal.getQ()));
  // TODO If we could store a terminal identifier in IIDM
  // we would not need to obtain it querying CGMES for the related equipment
  p.put(CgmesNames.TERMINAL, cgmes.terminalForEquipment(terminal.getConnectable().getId()));
  return p;
}

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

PossibleTopology.Equipment pt = new PossibleTopology.Equipment(t.getConnectable().getId(), i);
if (!t2eq.containsValue(pt) && eq2bus.containsKey(pt)) {
  t2eq.put(t, pt);

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

private void convertPatlCurrentTerminal(double value) {
  Connectable<?> connectable = terminal.getConnectable();
  if (connectable instanceof Branch) {
    int terminalNumber = context.terminalMapping().number(terminalId);
    Branch<?> b = (Branch<?>) connectable;
    if (terminalNumber == 1) {
      b.newCurrentLimits1().setPermanentLimit(value).add();
    } else if (terminalNumber == 2) {
      b.newCurrentLimits2().setPermanentLimit(value).add();
    } else {
      notAssigned(b);
    }
  } else if (connectable instanceof DanglingLine) {
    ((DanglingLine) connectable).newCurrentLimits().setPermanentLimit(value).add();
  } else {
    notAssigned(connectable);
  }
}

相关文章