Class AbstractLimitReductionsApplier<P,L>
- All Implemented Interfaces:
LimitsComputer<P,
L>
- Direct Known Subclasses:
DefaultLimitReductionsApplier
LimitReduction
.- Author:
- Sophie Frasnedo <sophie.frasnedo at rte-france.com>, Olivier Perrin <olivier.perrin at rte-france.com>
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static interface
Interface for objects allowing to retrieve limits (of generic typeAbstractLimitReductionsApplier.OriginalLimitsGetter
) from an object manageable by theLimitsComputer
(of generic typeAbstractLimitReductionsApplier.OriginalLimitsGetter
).Nested classes/interfaces inherited from interface com.powsybl.iidm.network.limitmodification.LimitsComputer
LimitsComputer.NoModificationsImpl
-
Field Summary
Fields inherited from interface com.powsybl.iidm.network.limitmodification.LimitsComputer
NO_MODIFICATIONS
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractLimitReductionsApplier
(List<LimitReduction> limitReductionList) Create a newAbstractLimitReductionsApplier
using a list of reductions. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract NetworkElement
asNetworkElement
(P processable) Return aNetworkElement
representation ofprocessable
(itself if it already is aNetworkElement
or an adapter).protected Optional<LimitsContainer<L>>
computeUncachedLimits
(P processable, LimitType limitType, ThreeSides side, boolean monitoringOnly) Retrieve the limits onprocessable
then apply modifications on them.protected abstract AbstractLimitsReducerCreator<L,
AbstractLimitsReducer<L>> Return theAbstractLimitsReducer
creator, which will be used to create an object of typeAbstractLimitReductionsApplier
containing the modified limits.protected abstract AbstractLimitReductionsApplier.OriginalLimitsGetter<P,
L> Return anAbstractLimitReductionsApplier.OriginalLimitsGetter
allowing to retrieveAbstractLimitReductionsApplier
from a network element of typeAbstractLimitReductionsApplier
.protected static boolean
isContingencyInContingencyContext
(ContingencyContext contingencyContext, String contingencyId) protected static boolean
isNetworkElementAffectedByLimitReduction
(NetworkElement networkElement, LimitReduction limitReduction) protected static boolean
isPermanentLimitAffectedByLimitReduction
(LimitReduction limitReduction) protected static boolean
isTemporaryLimitAffectedByLimitReduction
(int temporaryLimitAcceptableDuration, LimitReduction limitReduction) void
setWorkingContingency
(String contingencyId) Change the contingency for which the reduced limits must be computed.Methods inherited from class com.powsybl.iidm.network.limitmodification.AbstractLimitsComputerWithCache
clearCache, computeLimits, putInCache
-
Constructor Details
-
AbstractLimitReductionsApplier
Create a newAbstractLimitReductionsApplier
using a list of reductions.- Parameters:
limitReductionList
- the list of the reductions to use when computing reduced limits.
-
-
Method Details
-
computeUncachedLimits
protected Optional<LimitsContainer<L>> computeUncachedLimits(P processable, LimitType limitType, ThreeSides side, boolean monitoringOnly) Description copied from class:AbstractLimitsComputerWithCache
Retrieve the limits on
processable
then apply modifications on them.If no modifications applies on the resulting
LimitsContainer
must contains the same object for the original and the reduced limits.This function is called when the corresponding limits were not found in the cache.
This function is responsible for the addition of the computed limit in the cache (via the
AbstractLimitsComputerWithCache.putInCache(P, com.powsybl.iidm.network.LimitType, com.powsybl.iidm.network.ThreeSides, boolean, com.powsybl.iidm.network.limitmodification.result.LimitsContainer<L>)
method).- Specified by:
computeUncachedLimits
in classAbstractLimitsComputerWithCache<P,
L> - Parameters:
processable
- the network element for which the limits must be retrieved and modifiedlimitType
- the type of limits to processside
- the side of the network element where to retrieve the original limitsmonitoringOnly
- Iftrue
, compute the limits to use for a monitoring only use case. Iffalse
, compute the limits to use for a monitoring + action use case.- Returns:
- an object containing both the original and the modified limits.
-
getOriginalLimitsGetter
protected abstract AbstractLimitReductionsApplier.OriginalLimitsGetter<P,L> getOriginalLimitsGetter()Return anAbstractLimitReductionsApplier.OriginalLimitsGetter
allowing to retrieveAbstractLimitReductionsApplier
from a network element of typeAbstractLimitReductionsApplier
.- Returns:
- an original limits getter
-
getLimitsReducerCreator
protected abstract AbstractLimitsReducerCreator<L,AbstractLimitsReducer<L>> getLimitsReducerCreator()Return theAbstractLimitsReducer
creator, which will be used to create an object of typeAbstractLimitReductionsApplier
containing the modified limits.- Returns:
- the creator for
AbstractLimitsReducer
-
asNetworkElement
Return a
NetworkElement
representation ofprocessable
(itself if it already is aNetworkElement
or an adapter).- Parameters:
processable
- the object which limits should be computed.- Returns:
- a
NetworkElement
representation ofprocessable
-
setWorkingContingency
Change the contingency for which the reduced limits must be computed.
- Parameters:
contingencyId
- the ID of the new contingency, ornull
if you study the pre-contingency state.
-
isContingencyInContingencyContext
protected static boolean isContingencyInContingencyContext(ContingencyContext contingencyContext, String contingencyId) -
isNetworkElementAffectedByLimitReduction
protected static boolean isNetworkElementAffectedByLimitReduction(NetworkElement networkElement, LimitReduction limitReduction) -
isPermanentLimitAffectedByLimitReduction
-
isTemporaryLimitAffectedByLimitReduction
protected static boolean isTemporaryLimitAffectedByLimitReduction(int temporaryLimitAcceptableDuration, LimitReduction limitReduction)
-