|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.deepthought.sidious.rules.Rule dk.deepthought.sidious.rules.TemperatureRule
public final class TemperatureRule
This class represents a temperature rule.
The rule advocates for maintaining a mean temperature, and avoiding temperature boundaries.
Field Summary | |
---|---|
private double |
K_MAX
Coefficient for mathematical calculations |
private double |
K_MIN
Coefficient for mathematical calculations |
private static org.apache.commons.logging.Log |
logger
|
private static double |
MAXVALUE
Arbitrary max value. |
private static RuleProperty |
ruleProperty
The RuleProperty of this class |
private SuperLinkID |
SENSOR_ID
The ID of the sensor this Rule depends on. |
private double |
T_MAX
The max temperature. |
private double |
T_MEAN
The mean temperature. |
private double |
T_MIN
The min temperature. |
Constructor Summary | |
---|---|
TemperatureRule(SuperLinkID parentId)
Constructor. |
Method Summary | |
---|---|
(package private) double |
calculateDesire(double temperature)
This method calculates the desire for a given temperature. |
static TemperatureRule |
constructTemperatureRule(SuperLinkID parentID,
java.util.Properties properties)
Static factory for constructing a TemperatureRule with the specified properties. |
double |
desire(State currentState,
State newState,
Step step)
Method returns the calculated desire associated with the change from currentState to newState . |
java.util.Collection<Goal> |
getGoals()
Method returns a collection of immediate goals. |
(package private) double |
total(double curTemperature,
double newTemperature)
Method returns the calculated total desire of the input temperatures. |
Methods inherited from class dk.deepthought.sidious.rules.Rule |
---|
getAdjustableSetting, getAdjustableSettingFromParent, getExplanation, getParentID, getSensorValue, setParentID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log logger
private final SuperLinkID SENSOR_ID
private static RuleProperty ruleProperty
private final double T_MEAN
private final double T_MAX
private final double K_MAX
private final double K_MIN
private final double T_MIN
private static final double MAXVALUE
Constructor Detail |
---|
public TemperatureRule(SuperLinkID parentId)
parentId
- the id of the parent PlanRequester
Method Detail |
---|
public static TemperatureRule constructTemperatureRule(SuperLinkID parentID, java.util.Properties properties)
parentID
- the id of the parent PlanRequester
properties
- the properties
public double desire(State currentState, State newState, Step step)
Rule
currentState
to newState
.
The calculated desire must evaluate to [0,1], where 0 represents no desire for changing state, and 1 represents maximum desire for change.
Some rules are allowed to evaluate to values (much) larger than 1. This exception is only allowed if the outcome of not respecting the rule is fatal.
desire
in class Rule
currentState
- the current statenewState
- the new statestep
- the step
double total(double curTemperature, double newTemperature)
curTemperature
- current temperaturenewTemperature
- the new temperature
double calculateDesire(double temperature)
temperature
- the temperature
public java.util.Collection<Goal> getGoals()
Rule
If there are no immediate goals, an empty collection is returned.
getGoals
in class Rule
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |