Class IntervalTemporaryDurationCriterion
java.lang.Object
com.powsybl.iidm.criteria.duration.AbstractTemporaryDurationCriterion
com.powsybl.iidm.criteria.duration.IntervalTemporaryDurationCriterion
- All Implemented Interfaces:
LimitDurationCriterion
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>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.powsybl.iidm.criteria.duration.AbstractTemporaryDurationCriterion
AbstractTemporaryDurationCriterion.TemporaryDurationCriterionType
Nested classes/interfaces inherited from interface com.powsybl.iidm.criteria.duration.LimitDurationCriterion
LimitDurationCriterion.LimitDurationType
-
Field Summary
Fields inherited from interface com.powsybl.iidm.criteria.duration.LimitDurationCriterion
VERSION
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.lang3.IntegerRange
asRange()
Return anIntegerRange
representation corresponding to the criterion's interval.between
(int lowBound, int highBound, boolean lowClosed, boolean highClosed) Convenient method to easily create anIntervalTemporaryDurationCriterion
with only a upper bound.builder()
Return a builder to create anIntervalTemporaryDurationCriterion
.boolean
filter
(int acceptableDuration) Does the given acceptable duration respect the current duration criterion?Get the upper bound (in seconds) of the interval.Get the lower bound (in seconds) of the interval.greaterThan
(int value, boolean closed) Convenient method to easily create anIntervalTemporaryDurationCriterion
with only a lower bound.boolean
Is the interval closed on the upper side?boolean
Is the interval closed on the lower side?lowerThan
(int value, boolean closed) Convenient method to easily create anIntervalTemporaryDurationCriterion
with only a upper bound.Methods inherited from class com.powsybl.iidm.criteria.duration.AbstractTemporaryDurationCriterion
getType
-
Method Details
-
builder
Return a builder to create anIntervalTemporaryDurationCriterion
.- Returns:
- a builder
-
greaterThan
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 thelowBound
attribute of the interval)closed
- is the bound included in the interval (it corresponds to thelowClosed
attribute of the interval)- Returns:
- an interval
-
lowerThan
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 thehighBound
attribute of the interval)closed
- is the bound included in the interval (it corresponds to thehighClosed
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 thelowBound
attribute of the interval)lowClosed
- is the bound included in the interval (it corresponds to thelowClosed
attribute of the interval)highBound
- the upper bound (in seconds) of the interval to create (it corresponds to thehighBound
attribute of the interval)highClosed
- is the bound included in the interval (it corresponds to thehighClosed
attribute of the interval)- Returns:
- an interval
-
getComparisonType
- Specified by:
getComparisonType
in classAbstractTemporaryDurationCriterion
-
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 classAbstractTemporaryDurationCriterion
- Parameters:
acceptableDuration
- the duration to check- Returns:
true
if the given acceptable duration respects the current criterion,false
otherwise.
-
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
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
iflowBound
is part of the interval,false
otherwise.
-
isHighClosed
public boolean isHighClosed()Is the interval closed on the upper side?- Returns:
true
ifhighBound
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
-