Package io.openems.edge.ess.test
Class DummyPower
java.lang.Object
io.openems.edge.ess.test.DummyPower
- All Implemented Interfaces:
Power
-
Field Summary
Fields inherited from interface io.openems.edge.ess.power.api.Power
log, NO_CONSTRAINTS
-
Constructor Summary
ConstructorDescriptionCreates aDummyPower
with unlimited MaxApparentPower and disabled PID filter.DummyPower
(double p, double i, double d) Creates aDummyPower
with unlimited MaxApparentPower and PID filter with the given parameters.DummyPower
(int maxApparentPower) Creates aDummyPower
with given MaxApparentPower and disabled PID filter.DummyPower
(int maxApparentPower, double p, double i, double d) Creates aDummyPower
with given MaxApparentPower and PID filter with the given parameters.DummyPower
(int maxApparentPower, PidFilter pidFilter) -
Method Summary
Modifier and TypeMethodDescriptionaddConstraint
(Constraint constraint) Adds a Constraint.addConstraintAndValidate
(Constraint constraint) Adds a Constraint if the problem is still solvable afterwards.void
Registers aManagedSymmetricEss
with thisDummyPower
.createSimpleConstraint
(String description, ManagedSymmetricEss ess, Phase phase, Pwr pwr, Relationship relationship, double value) Creates a simple constraint.getCoefficient
(ManagedSymmetricEss ess, Phase phase, Pwr pwr) Gets the Coefficient singleton for a specific combination of ess, phase and pwr.int
getMaxPower
(ManagedSymmetricEss ess, Phase phase, Pwr pwr) Gets the maximum possible Power under the active Constraints.int
getMinPower
(ManagedSymmetricEss ess, Phase phase, Pwr pwr) Gets the minimum possible possible Power under the active Constraints.Gets the PidFilter instance with the configured P, I and D variables.boolean
Check if PidFilter is enabled.void
removeConstraint
(Constraint constraint) Removes a Constraint.void
setMaxApparentPower
(int maxApparentPower) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.openems.edge.ess.power.api.Power
fitValueIntoMinMaxPower, fitValueToMaxPower, fitValueToMinPower
-
Constructor Details
-
DummyPower
public DummyPower()Creates aDummyPower
with unlimited MaxApparentPower and disabled PID filter. -
DummyPower
public DummyPower(int maxApparentPower) Creates aDummyPower
with given MaxApparentPower and disabled PID filter.- Parameters:
maxApparentPower
- the MaxApparentPower
-
DummyPower
-
DummyPower
public DummyPower(double p, double i, double d) Creates aDummyPower
with unlimited MaxApparentPower and PID filter with the given parameters.- Parameters:
p
- the proportional gaini
- the integral gaind
- the derivative gain
-
DummyPower
public DummyPower(int maxApparentPower, double p, double i, double d) Creates aDummyPower
with given MaxApparentPower and PID filter with the given parameters.- Parameters:
maxApparentPower
- the MaxApparentPowerp
- the proportional gaini
- the integral gaind
- the derivative gain
-
-
Method Details
-
addEss
Registers aManagedSymmetricEss
with thisDummyPower
.- Parameters:
ess
- theManagedSymmetricEss
-
addConstraint
Description copied from interface:Power
Adds a Constraint.- Specified by:
addConstraint
in interfacePower
- Parameters:
constraint
- theConstraint
- Returns:
- the
Constraint
-
addConstraintAndValidate
Description copied from interface:Power
Adds a Constraint if the problem is still solvable afterwards.- Specified by:
addConstraintAndValidate
in interfacePower
- Parameters:
constraint
- theConstraint
- Returns:
- the
Constraint
- Throws:
PowerException
- on error
-
createSimpleConstraint
public Constraint createSimpleConstraint(String description, ManagedSymmetricEss ess, Phase phase, Pwr pwr, Relationship relationship, double value) Description copied from interface:Power
Creates a simple constraint.- Specified by:
createSimpleConstraint
in interfacePower
- Parameters:
description
- a description (for debug)ess
- theManagedSymmetricEss
phase
- thePhase
pwr
- thePwr
relationship
- theRelationship
value
- the value- Returns:
- the
Constraint
-
removeConstraint
Description copied from interface:Power
Removes a Constraint.- Specified by:
removeConstraint
in interfacePower
- Parameters:
constraint
- theConstraint
-
setMaxApparentPower
public void setMaxApparentPower(int maxApparentPower) -
getMaxPower
Description copied from interface:Power
Gets the maximum possible Power under the active Constraints.- Specified by:
getMaxPower
in interfacePower
- Parameters:
ess
- theManagedSymmetricEss
phase
- thePhase
pwr
- thePwr
- Returns:
- the maximum possible power
-
getMinPower
Description copied from interface:Power
Gets the minimum possible possible Power under the active Constraints.- Specified by:
getMinPower
in interfacePower
- Parameters:
ess
- theManagedSymmetricEss
phase
- thePhase
pwr
- thePwr
- Returns:
- the minimum possible power
-
getCoefficient
Description copied from interface:Power
Gets the Coefficient singleton for a specific combination of ess, phase and pwr.- Specified by:
getCoefficient
in interfacePower
- Parameters:
ess
- theManagedSymmetricEss
phase
- thePhase
pwr
- thePwr
- Returns:
- the
Coefficient
-
getPidFilter
Description copied from interface:Power
Gets the PidFilter instance with the configured P, I and D variables.- Specified by:
getPidFilter
in interfacePower
- Returns:
- an instance of
PidFilter
-
isPidEnabled
public boolean isPidEnabled()Description copied from interface:Power
Check if PidFilter is enabled.- Specified by:
isPidEnabled
in interfacePower
- Returns:
- true if PidFilter is enable, otherwise false
-