stella.sensor
Class WeirdSolZSensor
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiCaster
stella.sensor.AbstractSensor
stella.sensor.TimerTaskSensor
stella.sensor.DataSensor
stella.sensor.CumulativeSensor
stella.sensor.PredictiveSensor
stella.sensor.SmoothingSensor
stella.sensor.DerivativeSensor
stella.sensor.WeatherSensor
stella.sensor.SolZSensor
stella.sensor.WeirdSolZSensor
- All Implemented Interfaces:
- Cloneable, Remote, Caster, DataCaster, RmiDataCaster, RmiErrorCaster, Cumulating, Deriving, Predicting, Smoothing, Telemetering, WeatherJudging, WeatherCaster, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster, RmiPropertyBearing, PI
public class WeirdSolZSensor
- extends SolZSensor
This class is for testing the behaviour of the STELLA system if one sensor
suddenly starts producing weird data. For this purpose, this solz-sensor
sybling can additionally swap from correct response to Double.NaN response
and back again to normal response, decided by the keys
KEY_TIMEGOOD and KEY_TIMEBAD. After startup, the sensor
produces correct data until the good-time, KEY_TIMEGOOD, has run
out. It then toggles for KEY_TIMEBAD ms to Double.NaN readings.
|
Field Summary |
static long |
DEFTIME
The default noise level. |
static String |
KEY_TIMEBAD
The key describing the time span of invalid data delivery. |
static String |
KEY_TIMEGOOD
The key describing the time span of correct data delivery. |
private long |
toggle
The date of the last bad-good switch. |
| Fields inherited from class stella.sensor.WeatherSensor |
KEY_DERIVATIVEINVALID, KEY_DERIVATIVEPARAMETER, KEY_INVERSE, KEY_INVERSEDERIVATIVE, KEY_JUDGEDERIVATIVE, KEY_JUDGEPREDICT, KEY_JUDGERAW, KEY_JUDGESMOOTH, KEY_PREDICTINVALID, KEY_PREDICTPARAMETER, KEY_RAWINVALID, KEY_RAWPARAMETER, KEY_RETARDBADDERIVATIVE, KEY_RETARDBADPREDICT, KEY_RETARDBADRAW, KEY_RETARDBADSMOOTH, KEY_RETARDGOODDERIVATIVE, KEY_RETARDGOODPREDICT, KEY_RETARDGOODRAW, KEY_RETARDGOODSMOOTH, KEY_SMOOTHINVALID, KEY_SMOOTHPARAMETER |
|
Constructor Summary |
WeirdSolZSensor(Map qualify)
Constructs a fully-qualified sol z sensor. |
|
Method Summary |
double |
readSensor()
Reads the sensor. |
| Methods inherited from class stella.sensor.WeatherSensor |
addWeatherListener, conductOneMeasure, currentlyClear, currentlyRetarding, generateDataEvent, getMinClearUpTime, getSensorInitInfo, goodFromDerivative, goodFromPredict, goodFromRaw, goodFromSmooth, isDerivativeRetard, isPredictRetard, isRawRetard, isSmoothRetard, judgeWeather, notifyWeatherListener, removeWeatherListener, status |
| Methods inherited from class stella.sensor.TimerTaskSensor |
cancel, equals, getRawToggleInfo, getReading, getRespawn, getTimeOfRead, hashCode, initSensorTimerTask, isReady, regetRaw, setTimeOfRead, validReading |
| Methods inherited from class stella.sensor.AbstractSensor |
addRmiErrorListener, createSensor, getBindName, getConvert, getSensorDescription, getSensorName, init, notifyErrorListener, removeRmiErrorListener, setConvert, toString |
| Methods inherited from class util.PropertyResources |
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from interface util.PropertySupplying |
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
KEY_TIMEGOOD
public static final String KEY_TIMEGOOD
- The key describing the time span of correct data delivery.
- See Also:
- Constant Field Values
KEY_TIMEBAD
public static final String KEY_TIMEBAD
- The key describing the time span of invalid data delivery.
- See Also:
- Constant Field Values
DEFTIME
public static final long DEFTIME
- The default noise level.
- See Also:
- Constant Field Values
toggle
private long toggle
- The date of the last bad-good switch.
WeirdSolZSensor
public WeirdSolZSensor(Map qualify)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException,
RemoteException
- Constructs a fully-qualified sol z sensor. On output, this sensor
toggles between correct readings and Double.NaN, depending on the two
switch times
KEY_TIMEGOOD and KEY_TIMEBAD.
- Parameters:
qualify - The Properties object describing this sensor.
- Throws:
ClassNotFoundException - Should never be thrown, only on
implementation errors.
InstantiationException - Should never be thrown, only on
implementation errors.
IllegalAccessException - Should never be thrown, only on
implementation errors.
RemoteException
readSensor
public double readSensor()
- Reads the sensor. For the noisy solar z sensor this means calculating
the undisturbed value using the parents readSensor method and
adding gaussian noise to the value.
- Overrides:
readSensor in class SolZSensor
- Returns:
- The cosine of the solar zenith distance blured with white noise.
- See Also:
ConvertToPhysical