stella.xml
Class EvenlySpacedMerit

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.AbstractMerit
                  extended by stella.xml.EvenlySpacedMerit
All Implemented Interfaces:
Serializable, Cloneable, Meriting, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying
Direct Known Subclasses:
FixedDelayMerit, FixedRateMerit

public abstract class EvenlySpacedMerit
extends AbstractMerit

A class defining evently spaced time slot merits. Evenly spaced means that this merit tries to keep the time between observations of the target at a fixed frequency. It comes in two flavours, FixedDelayMerit and FixedRateMerit. These two classes differ in the way they evaluate the crucial parameter t0. The formular used for calculating this time slot merit is

 
   ts(t) = w[(t-t0)/p]α
   
Here, w is the {link #KEY_IMPACT} factor and p is the period aimed at. α is a double that defines the 'forgiveness' of the merit if the time aimed at is not yet reached. Values below one allow a rather shallow influence of the observation time aimed at, in the way that target picking is possible before the aim time and not much increased once this time has passed. Values above one more or less block target selection prior to the aim time with a sharp increase of propability once this time has passed.
If combined with a OneObservationMerit this merit can be used to additionally specify a number of maximum observations.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static double DEFPERIODDAY
          Default value for the period.
private static double DEFSTEEPNESS
          Default value for the period.
private static String DEFTIME
          Default time parameter name.
static String KEY_PERIOD
          The key linked to the period of the observations.
static String KEY_PERIODDAY
          The key linked to the period of the observations.
static String KEY_STEEPNESS
          The key linked to the steepness of the aim time influence.
static String KEY_TIME
          The key pointing to the name of the time parameter.
 
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 util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
protected EvenlySpacedMerit(Map prop)
          Constructs an evenly spaced merit.
 
Method Summary
 double getMerit(ParameterClustering set, TargetDefinition target, Collection ignore, long within)
          Calculates the actual time slot merit.
protected abstract  Date getT0(TargetDefinition target)
          Returns t0, a measurement of the last valid observations.
 
Methods inherited from class stella.AbstractMerit
createMerit, getInitializer, initMerit
 
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, init, 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, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
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.Initializable
init
 

Field Detail

KEY_PERIOD

public static final String KEY_PERIOD
The key linked to the period of the observations.

See Also:
Constant Field Values

KEY_PERIODDAY

public static final String KEY_PERIODDAY
The key linked to the period of the observations.

See Also:
Constant Field Values

KEY_STEEPNESS

public static final String KEY_STEEPNESS
The key linked to the steepness of the aim time influence.

See Also:
Constant Field Values

KEY_TIME

public static final String KEY_TIME
The key pointing to the name of the time parameter.

See Also:
Constant Field Values

DEFPERIODDAY

private static final double DEFPERIODDAY
Default value for the period. One day.

See Also:
Constant Field Values

DEFSTEEPNESS

private static final double DEFSTEEPNESS
Default value for the period. One day.

See Also:
Constant Field Values

DEFTIME

private static final String DEFTIME
Default time parameter name.

See Also:
Constant Field Values
Constructor Detail

EvenlySpacedMerit

protected EvenlySpacedMerit(Map prop)
Constructs an evenly spaced merit. Only non-abstract subclasses of this merit may be used.

Method Detail

getMerit

public double getMerit(ParameterClustering set,
                       TargetDefinition target,
                       Collection ignore,
                       long within)
Calculates the actual time slot merit. The current time minus the flavour-depending zero time is weighed to the required period (in ms). Depending on the time offset and the KEY_STEEPNESS of the merit, a value between zero and positive infinity is returned. The value returned one period after t0 is always one.
This merit is strictly increasing, thus we use the end time for evaluation.

Parameters:
set - Current observing conditions.
target - The actual target.
ignore - The list of targetes relevant to the actual target.
within - The relevant time span in ms.

getT0

protected abstract Date getT0(TargetDefinition target)
Returns t0, a measurement of the last valid observations. This method defines the two flavours of this merit.