stella.sensor
Class PredictiveDataEvent

java.lang.Object
  extended by java.util.EventObject
      extended by util.rmi.RmiEvent
          extended by stella.DataEvent
              extended by stella.sensor.RawDataEvent
                  extended by stella.sensor.CumulativeDataEvent
                      extended by stella.sensor.PredictiveDataEvent
All Implemented Interfaces:
Serializable, PostingEvent
Direct Known Subclasses:
SmoothDataEvent

public class PredictiveDataEvent
extends CumulativeDataEvent

Adds the predicted values from a PredictiveSensor to the data event generated.

See Also:
Serialized Form

Field Summary
private  Double predictmax
          The maximum predicted value if used as an average of data.
private  Double predictmin
          The minimum predicted value if used as an average of data.
private  Double predictraw
          The raw predicted value.
 
Fields inherited from class stella.DataEvent
FORMAT
 
Fields inherited from class util.rmi.RmiEvent
localHost, sourceName
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
PredictiveDataEvent(DataEvent de)
          Constructs a new predictive data event from a generic data event.
PredictiveDataEvent(Object src)
          Constructs a new predictive data event without any values specified.
 
Method Summary
 String getFormattedPredictMax()
          Returns the predicted raw maximum as a string, formatted according to the raw formatter.
 String getFormattedPredictMin()
          Returns the predicted raw minimum as a string, formatted according to the raw formatter.
 String getFormattedPredictPhysical()
          Returns the physical quantity formatted to its converter's format.
 String getFormattedPredictPhysicalMax()
          Returns the physical maximum formatted to its converter's format.
 String getFormattedPredictPhysicalMin()
          Returns the physical minimum formatted to its converter's format.
 String getFormattedPredictRaw()
          Returns the predicted raw reading as a string, formatted according to the raw formatter.
 double getPredictMax()
          Returns the maximum raw predicted value as a primitive double or nan if undefined.
 double getPredictMin()
          Returns the minimum raw predicted value as a primitive double or nan if undefined.
 double getPredictPhysical()
          Returns the predicted measurement in physically meaningful quantities or NaN if undefined.
 double getPredictPhysicalMax()
          Returns the maximum predicted measurement in physically meaningful quantities or NaN if undefined.
 double getPredictPhysicalMin()
          Returns the minimum predicted measurement in physically meaningful quantities or NaN if undefined.
 double getPredictRaw()
          Returns the raw predicted value as a primitive double or nan if undefined.
protected  String getValueString(Double meas)
          Formats a single raw reading according to the RawDataEvent.rawconvert conversion object, without adding any errors.
 void setPredictMinMax(double min, double max)
          Sets the minimum and maximum of the predicted raw value.
 void setPredictRaw(double predict)
          Sets the predicted value as a primitive double.
 String toString()
          Adds the predictive values to the string representation.
 
Methods inherited from class stella.sensor.CumulativeDataEvent
getDateString, getFormattedPhysicalMax, getFormattedPhysicalMin, getFormattedRawMax, getFormattedRawMin, getMinMaxString, getN, getPhysicalMax, getPhysicalMin, getRawMax, getRawMin, setN, setRawMinMax
 
Methods inherited from class stella.sensor.RawDataEvent
formatPhysical, formatRaw, getFormattedPhysical, getFormattedPhysicalDeviation, getFormattedRaw, getFormattedRawDeviation, getPhysical, getPhysicalDeviation, getRaw, getRawConvert, getRawDeviation, getRawFormat, getRawString, getSigmaFormat, setRaw, setRawConvert, setRawDeviation, setRawFormat, setSigmaFormat
 
Methods inherited from class stella.DataEvent
getMeasurement, getTimeOfMeasure, isValid, setMeasurement, setTimeOfMeasure, setValid
 
Methods inherited from class util.rmi.RmiEvent
getHost, getSourceName, setSourceName
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

predictraw

private Double predictraw
The raw predicted value.


predictmax

private Double predictmax
The maximum predicted value if used as an average of data.


predictmin

private Double predictmin
The minimum predicted value if used as an average of data.

Constructor Detail

PredictiveDataEvent

public PredictiveDataEvent(Object src)
Constructs a new predictive data event without any values specified.

Parameters:
src - The event source.

PredictiveDataEvent

public PredictiveDataEvent(DataEvent de)
Constructs a new predictive data event from a generic data event. All relevant field are copied.

Method Detail

setPredictRaw

public void setPredictRaw(double predict)
Sets the predicted value as a primitive double.


getPredictRaw

public double getPredictRaw()
Returns the raw predicted value as a primitive double or nan if undefined.


getFormattedPredictRaw

public String getFormattedPredictRaw()
Returns the predicted raw reading as a string, formatted according to the raw formatter. If the raw-formatter is null, Double.toString is used.


setPredictMinMax

public void setPredictMinMax(double min,
                             double max)
Sets the minimum and maximum of the predicted raw value. Useful only if generated from multiple data.


getPredictMin

public double getPredictMin()
Returns the minimum raw predicted value as a primitive double or nan if undefined.


getFormattedPredictMin

public String getFormattedPredictMin()
Returns the predicted raw minimum as a string, formatted according to the raw formatter. If the raw-formatter is null, Double.toString is used.


getPredictMax

public double getPredictMax()
Returns the maximum raw predicted value as a primitive double or nan if undefined.


getFormattedPredictMax

public String getFormattedPredictMax()
Returns the predicted raw maximum as a string, formatted according to the raw formatter. If the raw-formatter is null, Double.toString is used.


getPredictPhysical

public double getPredictPhysical()
Returns the predicted measurement in physically meaningful quantities or NaN if undefined.


getFormattedPredictPhysical

public String getFormattedPredictPhysical()
Returns the physical quantity formatted to its converter's format.


getPredictPhysicalMin

public double getPredictPhysicalMin()
Returns the minimum predicted measurement in physically meaningful quantities or NaN if undefined.


getFormattedPredictPhysicalMin

public String getFormattedPredictPhysicalMin()
Returns the physical minimum formatted to its converter's format.


getPredictPhysicalMax

public double getPredictPhysicalMax()
Returns the maximum predicted measurement in physically meaningful quantities or NaN if undefined.


getFormattedPredictPhysicalMax

public String getFormattedPredictPhysicalMax()
Returns the physical maximum formatted to its converter's format.


toString

public String toString()
Adds the predictive values to the string representation.

Overrides:
toString in class CumulativeDataEvent

getValueString

protected String getValueString(Double meas)
Formats a single raw reading according to the RawDataEvent.rawconvert conversion object, without adding any errors.