stella.util
Class SimulatorWeather

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by util.rmi.RmiPropertyContainer
                  extended by util.rmi.AbstractRmiCaster
                      extended by stella.sensor.AbstractWeatherSurveyor
                          extended by stella.sensor.WeatherStation
                              extended by stella.util.SimulatorWeather
All Implemented Interfaces:
Cloneable, Remote, EventListener, Caster, ClusterDepending, Parameter, RmiWeatherCaster, RmiWeatherReporting, WeatherPredicting, WeatherSurveying, Trigger, WeatherCaster, WeatherListener, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster, RmiPropertyBearing, StatusProviding

public class SimulatorWeather
extends WeatherStation

This class is the base class for simple or more sophisticated average-weather predictors to use in simulations of STELLA action. Normally, you will use it with a MasterMind in simulation mode, thus:

This class should at least serve a SolHeightSensor that, in turn, depends on a SettableTime value. For convenience it also toggles the KEY_GOODWEATHER good-weather trigger in the master mind's parameter set.

See Also:
SimulatorSequencer

Nested Class Summary
 
Nested classes/interfaces inherited from class stella.sensor.WeatherStation
WeatherStation.Manage, WeatherStation.Run, WeatherStation.WeatherStationData
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Nested classes/interfaces inherited from interface stella.sensor.WeatherSurveying
WeatherSurveying.DataBlock
 
Field Summary
private static String DEFGOODWEATHER
          The default name of the good-weather parameter.
private static String DEFSOLZ
          The default name of the solz-parameter.
private static String DEFTARGETNAME
          The default name of the time parameter.
private static String DEFTIME
          The default name of the time parameter.
private static double DEFTOGGLEHEIGHT
          The default z solar toggle value.
private  Trigger goodweather
          The good-weather trigger.
static String KEY_GOODWEATHER
          The name for the good weather trigger.
static String KEY_SOLZ
          The name for the solar heigth parameter.
static String KEY_TARGETNAME
          The name for the target name parameter.
static String KEY_TIME
          The name for the time value.
static String KEY_TOGGLEHEIGHT
          The key to the good-weather toggle height of the sun.
private  SolHeight solz
          The solar height parameter.
private  Parameter target
          The target name parameter, only used for logging.
private  Value time
          The time parameter, only used for logging.
 
Fields inherited from class stella.sensor.WeatherStation
KEY_BIND, KEY_DAEMON, KEY_DUMP, KEY_FILE, KEY_LIST, KEY_NAME, KEY_REPOSITORY
 
Fields inherited from class util.rmi.AbstractRmiCaster
ALTERNATEHOST, ALTERNATEPORT, KEY_BINDNAME, KEY_EXPORTPORT, KEY_REGISTRYHOST, KEY_REGISTRYPORT
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface stella.rmi.RmiWeatherCaster
NAMING_EXTENSION
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
SimulatorWeather(Map prop)
          Constructs a new weather simulator.
 
Method Summary
 boolean advanceFor(long observingtime)
          Checks what happens within the stated period of time in relation to weather events.
protected  void notifyWeatherListener(WeatherEvent good)
          Additionally sets the good-weather trigger.
 void registerCluster(ParameterClustering set)
          Grabs the solar height from the parameter set to check for possible advances.
 
Methods inherited from class stella.sensor.WeatherStation
addRmiWeatherListener, addSensor, containsRemoteProperty, exit, get, getAllSensorNames, getAllSensors, getCurrentlyRetarding, getCurrentWeather, getDataSensor, getElapsedToggleTime, getFormatted, getLastToggleTime, getName, getRemainsBadMaximum, getRemainsBadMinimum, getRemainsGoodMaximum, getRemainsGoodMinimum, getRemoteProperties, getRemoteProperty, getSensor, getStatus, getString, getTrigger, init, isTrue, provideStatus, registerSensorDriver, removeRmiWeatherListener, removeSensor, set, setRemoteProperty, setTrigger, startSensors, toggleTrigger, toString, weatherChanged
 
Methods inherited from class stella.sensor.AbstractWeatherSurveyor
addWeatherListener, createWeatherSurveyor, removeWeatherListener, status
 
Methods inherited from class util.rmi.AbstractRmiCaster
bindAlternate, bindToRegistry, bindToRegistry, bindToRegistry, casterExit, casterExit, getBindName, getBindName, isValid, unbindFromRegistry, unbindFromRegistry
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
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 class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.rmi.RmiCaster
bindToRegistry, isValid, unbindFromRegistry
 
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
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_SOLZ

public static final String KEY_SOLZ
The name for the solar heigth parameter.

See Also:
Constant Field Values

KEY_GOODWEATHER

public static final String KEY_GOODWEATHER
The name for the good weather trigger.

See Also:
Constant Field Values

KEY_TIME

public static final String KEY_TIME
The name for the time value.

See Also:
Constant Field Values

KEY_TARGETNAME

public static final String KEY_TARGETNAME
The name for the target name parameter.

See Also:
Constant Field Values

KEY_TOGGLEHEIGHT

public static final String KEY_TOGGLEHEIGHT
The key to the good-weather toggle height of the sun.

See Also:
Constant Field Values

DEFSOLZ

private static final String DEFSOLZ
The default name of the solz-parameter.

See Also:
Constant Field Values

DEFGOODWEATHER

private static final String DEFGOODWEATHER
The default name of the good-weather parameter.

See Also:
Constant Field Values

DEFTIME

private static final String DEFTIME
The default name of the time parameter.

See Also:
Constant Field Values

DEFTARGETNAME

private static final String DEFTARGETNAME
The default name of the time parameter.

See Also:
Constant Field Values

DEFTOGGLEHEIGHT

private static final double DEFTOGGLEHEIGHT
The default z solar toggle value.

See Also:
Constant Field Values

solz

private SolHeight solz
The solar height parameter.


goodweather

private Trigger goodweather
The good-weather trigger.


time

private Value time
The time parameter, only used for logging.


target

private Parameter target
The target name parameter, only used for logging.

Constructor Detail

SimulatorWeather

public SimulatorWeather(Map prop)
Constructs a new weather simulator. It is only used locally.

Method Detail

registerCluster

public void registerCluster(ParameterClustering set)
Grabs the solar height from the parameter set to check for possible advances. If this should also trigger, KEY_GOODWEATHER should point to a settable trigger. The time is found in KEY_TIME. For logging purpose, we might also assing the KEY_TARGETNAME parameter.

Specified by:
registerCluster in interface ClusterDepending
Overrides:
registerCluster in class WeatherStation

advanceFor

public boolean advanceFor(long observingtime)
Checks what happens within the stated period of time in relation to weather events. This method simulates the generation of weather events. Thus, two scenarii are possible. This method should be used by the MasterErrorHandler on target picks and by the MasterMind if no targets are available.


notifyWeatherListener

protected void notifyWeatherListener(WeatherEvent good)
Additionally sets the good-weather trigger.

Overrides:
notifyWeatherListener in class WeatherStation
Parameters:
good - The WeatherEvent to pass to the Listeners.