dk.deepthought.sidious.rules
Class MorningDropRule

java.lang.Object
  extended by dk.deepthought.sidious.rules.Rule
      extended by dk.deepthought.sidious.rules.MorningDropRule

public class MorningDropRule
extends Rule

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.

Author:
Deepthought

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

logger

private static final org.apache.commons.logging.Log logger
Logger for this class


ruleProperty

private static RuleProperty ruleProperty
The RuleProperty of this class


dropDuration

private final int dropDuration
The duration of the temperature drop.


minutesBeforeSunrise

private final int minutesBeforeSunrise
Drop initialization time, in minutes before sunrise.


dropTarget

private final double dropTarget
The target degrees of the drop.


timeSensorID

private final SuperLinkID timeSensorID
The ID of the time sensor this Rule depends on.


temperatureSensorID

private final SuperLinkID temperatureSensorID
The ID of the temperature sensor this Rule depends on.


sunrise

private static final int sunrise
The time of sunrise, represented in min after midnight.

XXX Should be retrieved from an external calendar/forecast.

See Also:
Constant Field Values
Constructor Detail

MorningDropRule

public MorningDropRule(SuperLinkID parentID)
Constructor.

Parameters:
parentID - the id of the parent PlanRequester
Method Detail

constructMorningDropRule

public static MorningDropRule constructMorningDropRule(SuperLinkID parentID,
                                                       java.util.Properties properties)
Static factory for constructing a MorningDropRule with the specified properties.

Parameters:
parentID - the id of the parent PlanRequester
properties - the properties
Returns:
a new MorningDropRule from the given properties

desire

public double desire(State currentState,
                     State newState,
                     Step step)
Description copied from class: Rule
Method returns the calculated desire associated with the change from 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.

Specified by:
desire in class Rule
Parameters:
currentState - the current state
newState - the new state
step - the step
Returns:
the calculated desire

getGoals

public java.util.Collection<Goal> getGoals()
Description copied from class: Rule
Method returns a collection of immediate goals.

If there are no immediate goals, an empty collection is returned.

Specified by:
getGoals in class Rule
Returns:
the goals of this rule


Copyright © Deepthought Development - All Rights Reserved.