@Test public void detectPermanentLimitOverloadOnSide2OfLine1() { detector.checkCurrent(line1, Branch.Side.TWO, 1101, violationsCollector::add); Assertions.assertThat(violationsCollector) .hasSize(1) .allSatisfy(l -> { assertEquals(1100, l.getLimit(), 0d); assertEquals(1101, l.getValue(), 0d); assertSame(Branch.Side.TWO, l.getSide()); assertEquals(600, l.getAcceptableDuration()); }); }
@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<?>) branch).getOptionalName().orElse(null), LimitViolationType.CURRENT, overload.getPreviousLimitName(), overload.getTemporaryLimit().getAcceptableDuration(), overload.getPreviousLimit(), limitReduction, value, side)); } else if (currentLimitTypes.contains(Security.CurrentLimitType.PATL)) { checkPermanentLimit(branch, side, value, consumer); } }
DefaultLimitViolationDetector extends AbstractContingencyBlindDetector { @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<?>) branch).getOptionalName().orElse(null), LimitViolationType.CURRENT, overload.getPreviousLimitName(), overload.getTemporaryLimit().getAcceptableDuration(), overload.getPreviousLimit(), limitReduction, value, side)); } else if (currentLimitTypes.contains(Security.CurrentLimitType.PATL)) { checkPermanentLimit(branch, side, value, consumer); } } }
DefaultLimitViolationDetector extends AbstractContingencyBlindDetector { @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<?>) branch).getOptionalName().orElse(null), LimitViolationType.CURRENT, overload.getPreviousLimitName(), overload.getTemporaryLimit().getAcceptableDuration(), overload.getPreviousLimit(), limitReduction, value, side)); } else if (currentLimitTypes.contains(Security.CurrentLimitType.PATL)) { checkPermanentLimit(branch, side, value, consumer); } } DefaultLimitViolationDetector(float limitReduction, Collection<Security.CurrentLimitType> currentLimitTypes);  DefaultLimitViolationDetector(Collection<Security.CurrentLimitType> currentLimitTypes);  DefaultLimitViolationDetector(); }
DefaultLimitViolationDetector extends AbstractContingencyBlindDetector { @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<?>) branch).getOptionalName().orElse(null), LimitViolationType.CURRENT, overload.getPreviousLimitName(), overload.getTemporaryLimit().getAcceptableDuration(), overload.getPreviousLimit(), limitReduction, value, side)); } else if (currentLimitTypes.contains(Security.CurrentLimitType.PATL)) { checkPermanentLimit(branch, side, value, consumer); } } DefaultLimitViolationDetector(float limitReduction, Collection<Security.CurrentLimitType> currentLimitTypes);  DefaultLimitViolationDetector(Collection<Security.CurrentLimitType> currentLimitTypes);  DefaultLimitViolationDetector(); @Override void checkCurrent(Branch branch, Branch.Side side, double value, Consumer<LimitViolation> consumer); @Override void checkVoltage(Bus bus, double value, Consumer<LimitViolation> consumer); }
DefaultLimitViolationDetector extends AbstractContingencyBlindDetector { @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<?>) branch).getOptionalName().orElse(null), LimitViolationType.CURRENT, overload.getPreviousLimitName(), overload.getTemporaryLimit().getAcceptableDuration(), overload.getPreviousLimit(), limitReduction, value, side)); } else if (currentLimitTypes.contains(Security.CurrentLimitType.PATL)) { checkPermanentLimit(branch, side, value, consumer); } } DefaultLimitViolationDetector(float limitReduction, Collection<Security.CurrentLimitType> currentLimitTypes);  DefaultLimitViolationDetector(Collection<Security.CurrentLimitType> currentLimitTypes);  DefaultLimitViolationDetector(); @Override void checkCurrent(Branch branch, Branch.Side side, double value, Consumer<LimitViolation> consumer); @Override void checkVoltage(Bus bus, double value, Consumer<LimitViolation> consumer);  }