Class ConstraintUtil
java.lang.Object
io.openems.edge.ess.core.power.data.ConstraintUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<Constraint>
createDisableConstraintsForInactiveInverters
(Coefficients coefficients, Collection<Inverter> inverters) Creates for each disabled inverter an EQUALS ZERO constraint.static List<Constraint>
createGenericEssConstraints
(Coefficients coefficients, List<ManagedSymmetricEss> esss, boolean symmetricMode) Creates for each Ess constraints for AllowedCharge, AllowedDischarge and MaxApparentPower.static List<Constraint>
createMetaEssConstraints
(Coefficients coefficients, List<ManagedSymmetricEss> esss, boolean symmetricMode) Creates Constraints forMetaEss
, e.g.static Constraint
createSimpleConstraint
(Coefficients coefficients, String description, String essId, Phase phase, Pwr pwr, Relationship relationship, double value) Creates a simple Constraint with only one Coefficient.static List<Constraint>
createSinglePhaseEssConstraints
(Coefficients coefficients, Collection<Inverter> inverters, boolean symmetricMode) For Single-Phase-ESS: Creates an EQUALS ZERO constraint for the not-connected phases.static List<Constraint>
createStaticEssConstraints
(List<ManagedSymmetricEss> esss, Consumer<Boolean> onStaticConstraintsFailed) Asks each Ess if it has any static Constraints and adds them.static List<Constraint>
createSumOfPhasesConstraints
(Coefficients coefficients, List<ManagedSymmetricEss> esss, boolean symmetricMode) Creates Constraints for Three-Phased Ess: P = L1 + L2 + L3.static List<Constraint>
createSymmetricEssConstraints
(Coefficients coefficients, List<ManagedSymmetricEss> esss, boolean symmetricMode) Creates Constraints for SymmetricEss, e.g.
-
Method Details
-
createSimpleConstraint
public static Constraint createSimpleConstraint(Coefficients coefficients, String description, String essId, Phase phase, Pwr pwr, Relationship relationship, double value) throws OpenemsException Creates a simple Constraint with only one Coefficient.- Parameters:
coefficients
- theCoefficients
description
- a description for the ConstraintessId
- the component Id of aManagedSymmetricEss
phase
- thePhase
pwr
- thePwr
relationship
- theRelationship
value
- the value- Returns:
- the
Constraint
- Throws:
OpenemsException
- on error
-
createDisableConstraintsForInactiveInverters
public static List<Constraint> createDisableConstraintsForInactiveInverters(Coefficients coefficients, Collection<Inverter> inverters) throws OpenemsException Creates for each disabled inverter an EQUALS ZERO constraint.- Parameters:
coefficients
- theCoefficients
inverters
- Collection ofInverter
s- Returns:
- List of
Constraint
s - Throws:
OpenemsException
- on error
-
createGenericEssConstraints
public static List<Constraint> createGenericEssConstraints(Coefficients coefficients, List<ManagedSymmetricEss> esss, boolean symmetricMode) throws OpenemsException Creates for each Ess constraints for AllowedCharge, AllowedDischarge and MaxApparentPower.- Parameters:
coefficients
- theCoefficients
esss
- list ofManagedSymmetricEss
ssymmetricMode
- Symmetric-Mode enabled?- Returns:
- List of
Constraint
s - Throws:
OpenemsException
- on error
-
createStaticEssConstraints
public static List<Constraint> createStaticEssConstraints(List<ManagedSymmetricEss> esss, Consumer<Boolean> onStaticConstraintsFailed) Asks each Ess if it has any static Constraints and adds them.- Parameters:
esss
- list ofManagedSymmetricEss
sonStaticConstraintsFailed
- callback forPowerComponent.ChannelId.STATIC_CONSTRAINTS_FAILED
channel- Returns:
- List of
Constraint
s
-
createSumOfPhasesConstraints
public static List<Constraint> createSumOfPhasesConstraints(Coefficients coefficients, List<ManagedSymmetricEss> esss, boolean symmetricMode) throws OpenemsException Creates Constraints for Three-Phased Ess: P = L1 + L2 + L3.If symmetricMode is activated, an empty list is returned.
- Parameters:
coefficients
- theCoefficients
esss
- list ofManagedSymmetricEss
ssymmetricMode
- Symmetric-Mode enabled?- Returns:
- List of Constraints
- Throws:
OpenemsException
- on error
-
createSymmetricEssConstraints
public static List<Constraint> createSymmetricEssConstraints(Coefficients coefficients, List<ManagedSymmetricEss> esss, boolean symmetricMode) throws OpenemsException Creates Constraints for SymmetricEss, e.g. L1 = L2 = L3.- Parameters:
coefficients
- theCoefficients
esss
- a list ofManagedSymmetricEss
symmetricMode
- Symmetric-Mode activated?- Returns:
- List of
Constraint
s - Throws:
OpenemsException
- on error
-
createSinglePhaseEssConstraints
public static List<Constraint> createSinglePhaseEssConstraints(Coefficients coefficients, Collection<Inverter> inverters, boolean symmetricMode) throws OpenemsException For Single-Phase-ESS: Creates an EQUALS ZERO constraint for the not-connected phases.If symmetricMode is activated, an empty list is returned.
- Parameters:
coefficients
- theCoefficients
inverters
- a list ofInverter
ssymmetricMode
- Symmetric-Mode activated?- Returns:
- List of Constraints
- Throws:
OpenemsException
- on error
-
createMetaEssConstraints
public static List<Constraint> createMetaEssConstraints(Coefficients coefficients, List<ManagedSymmetricEss> esss, boolean symmetricMode) throws OpenemsException Creates Constraints forMetaEss
, e.g. ClusterL1 = ess1_L1 + ess2_L1 + ...- Parameters:
coefficients
- theCoefficients
esss
- list ofManagedSymmetricEss
ssymmetricMode
- Symmetric-Mode enabled?- Returns:
- List of
Constraint
s - Throws:
OpenemsException
- on error
-