Package io.openems.edge.ess.api
Class PowerConstraint
java.lang.Object
io.openems.edge.ess.api.PowerConstraint
- All Implemented Interfaces:
ThrowingBiConsumer<ManagedSymmetricEss,
Integer, OpenemsError.OpenemsNamedException>
public class PowerConstraint
extends Object
implements ThrowingBiConsumer<ManagedSymmetricEss,Integer,OpenemsError.OpenemsNamedException>
This lambda friendly functional class creates a Power Constraint when a new
write-value is sent to the Channel (setNextWriteValue()). This new constraint
is directly validated and only added if the Power problem is still solvable
with the new constraint. Otherwise an error is logged.
-
Constructor Summary
ConstructorsConstructorDescriptionPowerConstraint
(String channelId, Phase phase, Pwr pwr, Relationship relationship) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ManagedSymmetricEss ess, Integer value) Performs this operation on the given arguments.static void
apply
(ManagedSymmetricEss ess, String description, Phase phase, Pwr pwr, Relationship relationship, Integer value) Apply aPowerConstraint
to aManagedSymmetricEss
, defined by its parameters.
-
Constructor Details
-
PowerConstraint
-
-
Method Details
-
accept
public void accept(ManagedSymmetricEss ess, Integer value) throws OpenemsError.OpenemsNamedException Description copied from interface:ThrowingBiConsumer
Performs this operation on the given arguments.- Specified by:
accept
in interfaceThrowingBiConsumer<ManagedSymmetricEss,
Integer, OpenemsError.OpenemsNamedException> - Parameters:
ess
- the first input argumentvalue
- the second input argument- Throws:
OpenemsError.OpenemsNamedException
-
apply
public static void apply(ManagedSymmetricEss ess, String description, Phase phase, Pwr pwr, Relationship relationship, Integer value) throws OpenemsException Apply aPowerConstraint
to aManagedSymmetricEss
, defined by its parameters.The implementation assures, that the value fits the existing constraints.
- Parameters:
ess
- the targetManagedSymmetricEss
description
- a descriptive text for log messagesphase
- the targetPhase
hpwr
- thePwr
moderelationship
- theRelationship
value
- the power value in [W] or [var]- Throws:
OpenemsException
- on error
-