Class IntervalTemporaryDurationCriterion

java.lang.Object
com.powsybl.iidm.criteria.duration.AbstractTemporaryDurationCriterion
com.powsybl.iidm.criteria.duration.IntervalTemporaryDurationCriterion
All Implemented Interfaces:
LimitDurationCriterion

public final class IntervalTemporaryDurationCriterion extends AbstractTemporaryDurationCriterion
Criterion used to filter temporary limits which acceptable durations are inside a given interval (in seconds).
Author:
Sophie Frasnedo <sophie.frasnedo at rte-france.com>
  • Method Details

    • builder

      Return a builder to create an IntervalTemporaryDurationCriterion.
      Returns:
      a builder
    • greaterThan

      public static IntervalTemporaryDurationCriterion greaterThan(int value, boolean closed)

      Convenient method to easily create an IntervalTemporaryDurationCriterion with only a lower bound.

      Parameters:
      value - the lower bound (in seconds) of the interval to create (it corresponds to the lowBound attribute of the interval)
      closed - is the bound included in the interval (it corresponds to the lowClosed attribute of the interval)
      Returns:
      an interval
    • lowerThan

      public static IntervalTemporaryDurationCriterion lowerThan(int value, boolean closed)

      Convenient method to easily create an IntervalTemporaryDurationCriterion with only a upper bound.

      Parameters:
      value - the upper bound (in seconds) of the interval to create (it corresponds to the highBound attribute of the interval)
      closed - is the bound included in the interval (it corresponds to the highClosed attribute of the interval)
      Returns:
      an interval
    • between

      public static IntervalTemporaryDurationCriterion between(int lowBound, int highBound, boolean lowClosed, boolean highClosed)

      Convenient method to easily create an IntervalTemporaryDurationCriterion with only a upper bound.

      Parameters:
      lowBound - the lower bound (in seconds) of the interval to create (it corresponds to the lowBound attribute of the interval)
      lowClosed - is the bound included in the interval (it corresponds to the lowClosed attribute of the interval)
      highBound - the upper bound (in seconds) of the interval to create (it corresponds to the highBound attribute of the interval)
      highClosed - is the bound included in the interval (it corresponds to the highClosed attribute of the interval)
      Returns:
      an interval
    • getComparisonType

      Specified by:
      getComparisonType in class AbstractTemporaryDurationCriterion
    • filter

      public boolean filter(int acceptableDuration)
      Description copied from class: AbstractTemporaryDurationCriterion
      Does the given acceptable duration respect the current duration criterion?
      Specified by:
      filter in class AbstractTemporaryDurationCriterion
      Parameters:
      acceptableDuration - the duration to check
      Returns:
      true if the given acceptable duration respects the current criterion, false otherwise.
    • getLowBound

      public Optional<Integer> getLowBound()
      Get the lower bound (in seconds) of the interval.
      Returns:
      lower bound of the acceptable interval (in seconds), or Optional.empty() if the interval has no lower bound.
    • getHighBound

      public Optional<Integer> getHighBound()
      Get the upper bound (in seconds) of the interval.
      Returns:
      upper bound of the acceptable interval (in seconds), or Optional.empty() if the interval has no upper bound.
    • isLowClosed

      public boolean isLowClosed()
      Is the interval closed on the lower side?
      Returns:
      true if lowBound is part of the interval, false otherwise.
    • isHighClosed

      public boolean isHighClosed()
      Is the interval closed on the upper side?
      Returns:
      true if highBound is part of the interval, false otherwise.
    • asRange

      public org.apache.commons.lang3.IntegerRange asRange()

      Return an IntegerRange representation corresponding to the criterion's interval.

      Returns:
      the criterion's interval as an IntegerRange