|
||||||||||
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.PhotosynthesisRule
public class PhotosynthesisRule
Class represents a photosynthesis rule.
It is responsible for maintaining a desired photosynthesis rate.
Field Summary | |
---|---|
private static long |
calculationCounter
Used to keep track of the amount of model calculations done by this |
private static int |
CO2_END
|
(package private) static int |
CO2_INCREMENT
|
(package private) static int |
CO2_START
|
private static double |
DESIRED_RATE
|
private static double |
GLASS_FACTOR
Value is defaulted in the calculate method. |
private static org.apache.commons.logging.Log |
logger
Logger for this class |
private static RuleProperty |
ruleProperty
The RuleProperty of this class |
private static double |
SHADE_FACTOR
Value is defaulted in the calculate method. |
private static int |
T_END
|
(package private) static int |
T_START
|
private double |
tweakValue
Value sets the importance of this rule. |
Constructor Summary | |
---|---|
PhotosynthesisRule(SuperLinkID parentID)
|
Method Summary | |
---|---|
(package private) double |
calculateDesire(State state,
Step step)
Returns the desire related to DESIRED_RATE . |
(package private) double |
calculateMax(double shade,
double sun,
java.util.ArrayList<java.util.ArrayList<java.lang.Double>> matrix)
Method calculates the maximum photosynthesis level. |
private double |
calculateRate(State state)
Calculates the photosynthesis rate for a given state. |
double |
desire(State currentState,
State newState,
Step step)
Method returns the calculated desire associated with the change from currentState to newState . |
static long |
getCalculationCounter()
Gets the amount of calculations made by this. |
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 static final double GLASS_FACTOR
private static final double SHADE_FACTOR
static final int T_START
static final int CO2_START
static final int CO2_INCREMENT
private static final int T_END
private static final int CO2_END
private static final double DESIRED_RATE
private double tweakValue
private static long calculationCounter
Constructor Detail |
---|
public PhotosynthesisRule(SuperLinkID parentID)
Method Detail |
---|
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 calculateDesire(State state, Step step)
DESIRED_RATE
.
state
- the state containing needed sensorsstep
- the step containing needed adjustables
private double calculateRate(State state)
state
- the state
double calculateMax(double shade, double sun, java.util.ArrayList<java.util.ArrayList<java.lang.Double>> matrix)
The format of the matrix is:
Rows = temperature interval Columns = CO2 level [t1=[co2_level_1, co2_level_2, co2_level_3, ... , co2_level_n]] [t2=[co2_level_1, co2_level_2, co2_level_3, ... , co2_level_n]] [t3=[co2_level_1, co2_level_2, co2_level_3, ... , co2_level_n]] ... [tm=[co2_level_1, co2_level_2, co2_level_3, ... , co2_level_n]] Where: CO2_START < n < CO2_END, and T_START < m < T_END Increments: Temperature increment = 1 CO2 increment = CO2_INCREMENT
shade
- screen setpoint valuesun
- irradiance levelmatrix
- the matrix to be filled with all calculated values
public java.util.Collection<Goal> getGoals()
Rule
If there are no immediate goals, an empty collection is returned.
getGoals
in class Rule
public static long getCalculationCounter()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |