dk.deepthought.sidious.greenhouse
Class HeaterSetPoint

java.lang.Object
  extended by dk.deepthought.sidious.greenhouse.HeaterSetPoint
All Implemented Interfaces:
Adjustable

@Immutable
public final class HeaterSetPoint
extends java.lang.Object
implements Adjustable

This class implements the abstraction of a setpoint of the heater.

Author:
Deepthought

Nested Class Summary
private static class HeaterSetPoint.HeaterStep
          Internal enum to describe possible adjustments.
 
Field Summary
private static double FACTOR_PER_MINUTE
           
private  SuperLinkID humidityID
          Id of the humidity sensor.
private static org.apache.commons.logging.Log logger
           
private  double setting
          The setting of this setpoint.
private  SuperLinkID temperatureID
          Id of the temperature sensor.
 
Constructor Summary
HeaterSetPoint(double setting)
          Creates a new HeaterSetPoint with the specified setting.
 
Method Summary
 State consequence(State state)
          Calculates the consequense of applying this adjustable to the specified state.
private  double decreaseFactor(double humidity)
          Calculates the humidity decrease factor with respect to the increase in temperature.
 boolean equals(java.lang.Object obj)
           
 SuperLinkID getID()
          Returns the id of this Adjustable.
 double getSetting()
          Returns the setting of this Adjustable.
 int hashCode()
           
 java.util.Collection<Adjustable> possibleAdjustments()
          Returns the possible adjustments from the current setting of this Adjustable.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

private static final org.apache.commons.logging.Log logger

setting

private final double setting
The setting of this setpoint.


temperatureID

private final SuperLinkID temperatureID
Id of the temperature sensor.


humidityID

private final SuperLinkID humidityID
Id of the humidity sensor.


FACTOR_PER_MINUTE

private static final double FACTOR_PER_MINUTE
See Also:
Constant Field Values
Constructor Detail

HeaterSetPoint

public HeaterSetPoint(double setting)
Creates a new HeaterSetPoint with the specified setting.

Parameters:
setting - the setting
Method Detail

consequence

public State consequence(State state)
Description copied from interface: Adjustable
Calculates the consequense of applying this adjustable to the specified state.

Returns a new State as the calculated consequence of applying this adjustable to the specified state.

Specified by:
consequence in interface Adjustable
Parameters:
state - the input state
Returns:
the resulting State from applying this adjustable to state

decreaseFactor

private double decreaseFactor(double humidity)
Calculates the humidity decrease factor with respect to the increase in temperature.

Parameters:
humidity - value of humidity
Returns:
the decrease factor

possibleAdjustments

public java.util.Collection<Adjustable> possibleAdjustments()
Description copied from interface: Adjustable
Returns the possible adjustments from the current setting of this Adjustable.

The resulting adjustments represent all currently possible adjustments that can be applied to this adjustable.

Specified by:
possibleAdjustments in interface Adjustable
Returns:
the new possible settings

getID

public SuperLinkID getID()
Description copied from interface: Adjustable
Returns the id of this Adjustable.

Specified by:
getID in interface Adjustable
Returns:
the id of this adjustable

getSetting

public double getSetting()
Description copied from interface: Adjustable
Returns the setting of this Adjustable.

Specified by:
getSetting in interface Adjustable
Returns:
the setting of this adjustable

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © Deepthought Development - All Rights Reserved.