public static LinkedHashMap<String, Double> getBranchesData(Network network) { LinkedHashMap<String, Double> branchesData = new LinkedHashMap<>(); network.getBranchStream().forEach(branch -> { addBranchSideData(branchesData, branch.getId(), branch.getTerminal1(), branch.getCurrentLimits1() == null ? Double.NaN : branch.getCurrentLimits1().getPermanentLimit()); addBranchSideData(branchesData, branch.getId(), branch.getTerminal2(), branch.getCurrentLimits2() == null ? Double.NaN : branch.getCurrentLimits2().getPermanentLimit()); }); return branchesData; }
private void checkPermanentLimit(Branch branch, Branch.Side side, double value, Consumer<LimitViolation> consumer) { if (LimitViolationUtils.checkPermanentLimit(branch, side, limitReduction, value)) { consumer.accept(new LimitViolation(branch.getId(), branch.getName(), LimitViolationType.CURRENT, null, Integer.MAX_VALUE, branch.getCurrentLimits(side).getPermanentLimit(), limitReduction, value, side)); } }
UniqueTopology topo1 = uniqueTopos.get(branch.getTerminal1().getVoltageLevel().getId()); UniqueTopology topo2 = uniqueTopos.get(branch.getTerminal2().getVoltageLevel().getId()); if (!topo1.containsEquipment(branch.getId()) && !topo2.containsEquipment(branch.getId())) { if (branch.getId().contains(TopologyHistory.FICTIVE_PATTERN)) { fictiveEquipmentsRemoved.add(branch.getId()); } else { equipmentsRemoved.add(branch.getId());
LOGGER.info("#------------------------ --------------- --------------- --------------- --------------- "); for (Branch trafo : network.getTwoWindingsTransformers()) { LOGGER.info(String.format("%s %15.8f %15.8f %15.8f %15.8f", trafo.getId(), trafo.getTerminal1().getQ(), trafo.getTerminal2().getQ(), trafo.getTerminal1().getP(), trafo.getTerminal2().getP()));
@Override public void checkCurrent(Branch branch, Branch.Side side, double value, Consumer<LimitViolation> consumer) { Branch.Overload overload = LimitViolationUtils.checkTemporaryLimits(branch, side, limitReduction, value); if (currentLimitTypes.contains(Security.CurrentLimitType.TATL) && (overload != null)) { consumer.accept(new LimitViolation(branch.getId(), branch.getName(), LimitViolationType.CURRENT, overload.getPreviousLimitName(), overload.getTemporaryLimit().getAcceptableDuration(), overload.getPreviousLimit(), limitReduction, branch.getTerminal(side).getI(), side)); } else if (currentLimitTypes.contains(Security.CurrentLimitType.PATL)) { checkPermanentLimit(branch, side, value, consumer); } }
valueMap.put(new HistoDbNetworkAttributeId(branch.getId(), t.getVoltageLevel().getId(), HistoDbAttr.P), context.p); valueMap.put(new HistoDbNetworkAttributeId(branch.getId(), t.getVoltageLevel().getId(), HistoDbAttr.Q), context.q); valueMap.put(new HistoDbNetworkAttributeId(branch.getId(), t.getVoltageLevel().getId(), HistoDbAttr.V), context.v); valueMap.put(new HistoDbNetworkAttributeId(branch.getId(), t.getVoltageLevel().getId(), HistoDbAttr.I), context.i);
private void writeBranchCurrentLimits(TableFormatter formatter) throws IOException { for (Branch branch : network.getBranches()) { String branchId = branch.getId(); if (branch.getCurrentLimits1() != null) { writeTemporaryCurrentLimits(branch.getCurrentLimits1(), formatter, branchId, true, "_1_"); } if (branch.getCurrentLimits2() != null) { writeTemporaryCurrentLimits(branch.getCurrentLimits2(), formatter, branchId, false, "_2_"); } } }
private static void dumpLimits(EurostagDictionary dictionary, BufferedWriter writer, Branch branch) throws IOException { dumpLimits(dictionary, writer, branch.getId(), branch.getCurrentLimits1(), branch.getCurrentLimits2(), branch.getTerminal1().getVoltageLevel().getNominalV(), branch.getTerminal2().getVoltageLevel().getNominalV()); }
LOGGER.debug("State {}: changing current limit 1 of branch {}: {} -> {}", stateId, branch.getId(), violation.getLimit(), newLimit); LOGGER.debug("State {}: changing current limit 1 of branch {}: {} -> {}", StateManagerConstants.INITIAL_STATE_ID, branch.getId(), violation.getLimit(), newLimit); LOGGER.debug("State {}: changing current limit 2 of branch {}: {} -> {}", stateId, branch.getId(), violation.getLimit(), newLimit); LOGGER.debug("State {}: changing current limit 2 of branch {}: {} -> {}", StateManagerConstants.INITIAL_STATE_ID, branch.getId(), violation.getLimit(), newLimit);
nodeName2 = parseName(bus2.getId()); String branchName = parseName(branch.getId()); //CIM ID
if (equipIds != null && !equipIds.contains(l.getId())) { continue; && (countries == null || countries.contains( l.getTerminal1().getVoltageLevel().getSubstation().getCountry().toString()))) { String terminalId = l.getId() + "__TO__" + l.getTerminal1().getVoltageLevel().getId(); if (measureTypes == null || measureTypes.contains("P")) { attributes.add(new Attribute(terminalId + "_P")); && (countries == null || countries.contains( l.getTerminal2().getVoltageLevel().getSubstation().getCountry().toString()))) { String terminalId = l.getId() + "__TO__" + l.getTerminal2().getVoltageLevel().getId(); if (measureTypes == null || measureTypes.contains("P")) { attributes.add(new Attribute(terminalId + "_P"));
private Load replaceBranchByLoad(Branch<?> branch, VoltageLevel vl, Terminal terminal) { LoadAdder loadAdder = vl.newLoad() .setId(branch.getId()) .setName(branch.getName()) .setLoadType(LoadType.FICTITIOUS) .setP0(checkP(terminal)) .setQ0(checkQ(terminal)); fillNodeOrBus(loadAdder, terminal); branch.remove(); Load load = loadAdder.add(); load.getTerminal() .setP(terminal.getP()) .setQ(terminal.getQ()); return load; }