@Override public boolean checkPermanentLimit(Side side) { return checkPermanentLimit(side, 1f); }
@Override public boolean isOverloaded(float limitReduction) { return checkPermanentLimit1(limitReduction) || checkPermanentLimit2(limitReduction); }
@Override public Branch.Overload checkTemporaryLimits(Side side) { return checkTemporaryLimits(side, 1f); }
@Override public Terminal getTerminal(Side side) { switch (side) { case ONE: return getTerminal1(); case TWO: return getTerminal2(); default: throw new AssertionError(); } }
@Override public Branch.Overload checkTemporaryLimits(Side side, float limitReduction) { Objects.requireNonNull(side); switch (side) { case ONE: return checkTemporaryLimits1(limitReduction); case TWO: return checkTemporaryLimits2(limitReduction); default: throw new AssertionError(); } }
@Override public boolean checkPermanentLimit1(float limitReduction) { return LimitViolationUtils.checkPermanentLimit(this, Side.ONE, limitReduction, getTerminal1().getI()); }
@Override public Branch.Overload checkTemporaryLimits2() { return checkTemporaryLimits2(1f); } }
@Override public boolean checkPermanentLimit2() { return checkPermanentLimit2(1f); }
@Override public boolean checkPermanentLimit1() { return checkPermanentLimit1(1f); }
@Override public Branch.Overload checkTemporaryLimits1() { return checkTemporaryLimits1(1f); }
@Override public void allocateVariantArrayElement(int[] indexes, int sourceIndex) { super.allocateVariantArrayElement(indexes, sourceIndex); if (ratioTapChanger != null) { ratioTapChanger.allocateVariantArrayElement(indexes, sourceIndex); } if (phaseTapChanger != null) { phaseTapChanger.allocateVariantArrayElement(indexes, sourceIndex); } }
@Override public void deleteVariantArrayElement(int index) { super.deleteVariantArrayElement(index); if (ratioTapChanger != null) { ratioTapChanger.deleteVariantArrayElement(index); } if (phaseTapChanger != null) { phaseTapChanger.deleteVariantArrayElement(index); } }
@Override public void extendVariantArraySize(int initVariantArraySize, int number, int sourceIndex) { super.extendVariantArraySize(initVariantArraySize, number, sourceIndex); if (ratioTapChanger != null) { ratioTapChanger.extendVariantArraySize(initVariantArraySize, number, sourceIndex); } if (phaseTapChanger != null) { phaseTapChanger.extendVariantArraySize(initVariantArraySize, number, sourceIndex); } }
@Override public int getOverloadDuration() { Branch.Overload o1 = checkTemporaryLimits1(); Branch.Overload o2 = checkTemporaryLimits2(); int duration1 = o1 != null ? o1.getTemporaryLimit().getAcceptableDuration() : Integer.MAX_VALUE; int duration2 = o2 != null ? o2.getTemporaryLimit().getAcceptableDuration() : Integer.MAX_VALUE; return Math.min(duration1, duration2); }
@Override public Terminal getTerminal(String voltageLevelId) { Objects.requireNonNull(voltageLevelId); boolean side1 = getTerminal1().getVoltageLevel().getId().equals(voltageLevelId); boolean side2 = getTerminal2().getVoltageLevel().getId().equals(voltageLevelId); if (side1 && side2) { throw new PowsyblException("Both terminals are connected to voltage level " + voltageLevelId); } else if (side1) { return getTerminal1(); } else if (side2) { return getTerminal2(); } else { throw new PowsyblException("No terminal connected to voltage level " + voltageLevelId); } }
@Override public Branch.Overload checkTemporaryLimits1(float limitReduction) { return LimitViolationUtils.checkTemporaryLimits(this, Side.ONE, limitReduction, getTerminal1().getI()); }
@Override public boolean checkPermanentLimit(Side side, float limitReduction) { Objects.requireNonNull(side); switch (side) { case ONE: return checkPermanentLimit1(limitReduction); case TWO: return checkPermanentLimit2(limitReduction); default: throw new AssertionError(); } }