|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.deepthought.sidious.greenhouse.ClimaticState
@Immutable public class ClimaticState
This class represents a climatic state of the environment. It is a collection of environmental sensor inputs.
Field Summary | |
---|---|
private static org.apache.commons.logging.Log |
logger
Logger for this class. |
(package private) static java.util.Comparator<SensorInput> |
SENSOR_ORDER
This comparator orders sensors by their SuperLinkID . |
private java.util.List<SensorInput> |
sensors
The list of sensors. |
Constructor Summary | |
---|---|
ClimaticState(java.util.Collection<SensorInput> sensors)
Creates a ClimaticState object containing the specified
sensor inputs. |
Method Summary | |
---|---|
(package private) static ClimaticState |
average(java.util.Collection<ClimaticState> states)
Calculates and returns the average State , based on the
input states . |
boolean |
equals(java.lang.Object obj)
|
java.util.Collection<SensorInput> |
getSensors()
Gets a Collection of SensorInput |
int |
hashCode()
|
State |
impact(java.util.Collection<State> states)
Calculates and returns the collective impact of applying the input states to the current environment. |
private ClimaticState |
incrementTime()
Increments the time of this. |
boolean |
partiallyEquals(State state)
Checks whether this state contains all state descriptors of the input state. |
boolean |
sameStateSpace(State other)
Verifies if the specified state belongs to the same state space as this. |
(package private) ClimaticState |
sum(ClimaticState other)
This method calculates the sum of this ClimaticState and
other . |
(package private) static java.util.ArrayList<ClimaticState> |
toClimaticStateList(java.util.Collection<State> states)
This method converts the input State objects to a list of
ClimaticState objects. |
java.lang.String |
toString()
|
(package private) static ClimaticState |
total(java.util.ArrayList<ClimaticState> states,
ClimaticState total)
This method calculates the total sum of all related sensor inputs in the states . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log logger
private final java.util.List<SensorInput> sensors
static final java.util.Comparator<SensorInput> SENSOR_ORDER
SuperLinkID
.
Constructor Detail |
---|
public ClimaticState(java.util.Collection<SensorInput> sensors)
ClimaticState
object containing the specified
sensor inputs.
sensors
- a collection of sensor inputs related this climatic stateMethod Detail |
---|
public State impact(java.util.Collection<State> states)
State
states
to the current environment.
impact
in interface State
states
- the input states
static ClimaticState average(java.util.Collection<ClimaticState> states)
State
, based on the
input states
.
The method returns null
, when presented with
null
or an empty collection.
states
- states to base calculation on
static java.util.ArrayList<ClimaticState> toClimaticStateList(java.util.Collection<State> states)
State
objects to a list of
ClimaticState
objects.
states
- input states to be concerted
static ClimaticState total(java.util.ArrayList<ClimaticState> states, ClimaticState total)
states
. The sum is calculated recursively.
The method returns null
, when presented with
null
or an empty collection.
states
- the list of climatic states to be summedtotal
- the parameter in which the sum will be calculated; is needed
for recursive purposes
ClimaticState
representing the total sum of the
related sensor inputsClimaticState sum(ClimaticState other)
ClimaticState
and
other
.
The method returns a deep-copy of this
, when presented
with null
.
other
- the other climatic statepublic boolean sameStateSpace(State other)
State
Returns true
if this state and other
are in
the same state space, false
otherwise.
sameStateSpace
in interface State
other
- the other state
true
if in same state space, false
otherwise.public boolean partiallyEquals(State state)
State
partiallyEquals
in interface State
state
- input state
true
if all state descriptors are includedpublic java.util.Collection<SensorInput> getSensors()
Collection
of SensorInput
private ClimaticState incrementTime()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |