|
||||||||||
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.MorningDropRule
public class MorningDropRule
This class represents the rule to facilitate a morning drop.
This rule will dictate a 5 to 6 degrees Celsius drop in temperature, starting approx. 30 min before sunrise, and maintaining this drop for two hours.
Field Summary | |
---|---|
private int |
dropDuration
The duration of the temperature drop. |
private double |
dropTarget
The target degrees of the drop. |
private static org.apache.commons.logging.Log |
logger
Logger for this class |
private int |
minutesBeforeSunrise
Drop initialization time, in minutes before sunrise. |
private static RuleProperty |
ruleProperty
The RuleProperty of this class |
private static int |
sunrise
The time of sunrise, represented in min after midnight. |
private SuperLinkID |
temperatureSensorID
The ID of the temperature sensor this Rule depends on. |
private SuperLinkID |
timeSensorID
The ID of the time sensor this Rule depends on. |
Constructor Summary | |
---|---|
MorningDropRule(SuperLinkID parentID)
Constructor. |
Method Summary | |
---|---|
static MorningDropRule |
constructMorningDropRule(SuperLinkID parentID,
java.util.Properties properties)
Static factory for constructing a MorningDropRule 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. |
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 static RuleProperty ruleProperty
private final int dropDuration
private final int minutesBeforeSunrise
private final double dropTarget
private final SuperLinkID timeSensorID
private final SuperLinkID temperatureSensorID
private static final int sunrise
XXX Should be retrieved from an external calendar/forecast.
Constructor Detail |
---|
public MorningDropRule(SuperLinkID parentID)
parentID
- the id of the parent PlanRequester
Method Detail |
---|
public static MorningDropRule constructMorningDropRule(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
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 |