stella.xml
Class TerminalMerit

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.AbstractMerit
                  extended by stella.xml.TerminalMerit
All Implemented Interfaces:
Serializable, Cloneable, EndpointDefining, Meriting, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class TerminalMerit
extends AbstractMerit
implements EndpointDefining

A merit calculating its timeslot as being constant until a certain time in the future, then rather appruptely falling to zero. The steepness of the decrease can be tuned with the KEY_WIDTH (σ) parameter, while the terminal point, at which the timeslot has fallen to half of its value, is defined with KEY_T0 (t0). The overall weight of the merit, i.e. its scaling between zero and one, is defined in KEY_WEIGHT (k). The drop is modeled on top of a tanh function. The default value of KEY_TANHSTRETCH (s) is almost always sufficient. Different time paramters can be used, the default is julian date. The formula used in the region stretching from t0-σ to t0+σ reads as follows

   ts(t) = k·½(1-tanh(s·(t-t0)/σ))
   
Outside this region, the merit is k or zero. This merit is EndpointDefining.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static double DEFTANHSTRETCH
          The default stretch factor in the tanh-transition region.
private static String DEFTIME
          Default remaining night-time parameter name.
private static double DEFWEIGHT
          Default value for the weight.
private static double DEFWIDTH
          Default half-width of the transition region.
static String KEY_T0
          The terminal time, in the middle of the drop-to-zero intervall.
static String KEY_TANHSTRETCH
          The key linked to the stretch of the tanh in the drop phase.
static String KEY_TIME
          The name of the time parameter used.
static String KEY_WEIGHT
          The key linked to the weight of the terminal merit.
static String KEY_WIDTH
          Half of the time it takes the merit to drop to zero.
 
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
TerminalMerit(Map prop)
          Constructs a new window merit using only default weights and impacts.
 
Method Summary
 double getMerit(ParameterClustering set, TargetDefinition target, Collection ignore, long dummy)
          Calculates the terminal merit.
 boolean isCompleted(ParameterClustering set, TargetDefinition target)
          Test, if this target is completed.
 
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 stella.Meriting
getInitializer, initMerit
 
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_WEIGHT

public static final String KEY_WEIGHT
The key linked to the weight of the terminal merit.

See Also:
Constant Field Values

KEY_WIDTH

public static final String KEY_WIDTH
Half of the time it takes the merit to drop to zero.

See Also:
Constant Field Values

KEY_T0

public static final String KEY_T0
The terminal time, in the middle of the drop-to-zero intervall.

See Also:
Constant Field Values

KEY_TANHSTRETCH

public static final String KEY_TANHSTRETCH
The key linked to the stretch of the tanh in the drop phase.

See Also:
Constant Field Values

KEY_TIME

public static final String KEY_TIME
The name of the time parameter used.

See Also:
Constant Field Values

DEFWEIGHT

private static final double DEFWEIGHT
Default value for the weight.

See Also:
Constant Field Values

DEFWIDTH

private static final double DEFWIDTH
Default half-width of the transition region.

See Also:
Constant Field Values

DEFTANHSTRETCH

private static final double DEFTANHSTRETCH
The default stretch factor in the tanh-transition region.

See Also:
Constant Field Values

DEFTIME

private static final String DEFTIME
Default remaining night-time parameter name.

See Also:
Constant Field Values
Constructor Detail

TerminalMerit

public TerminalMerit(Map prop)
Constructs a new window merit using only default weights and impacts. The proper way to create a window merit is using the AbstractMerit.createMerit(java.util.Map) method. This create method also takes care of proper parameter overloading.

Method Detail

getMerit

public double getMerit(ParameterClustering set,
                       TargetDefinition target,
                       Collection ignore,
                       long dummy)
Calculates the terminal merit. After a certain time, the target will never be picked again, thus returning zero. This merit focuses on the starting time of the target, thus the time span is ignored.

Specified by:
getMerit in interface Meriting
Parameters:
set - Current observing conditions.
target - The actual target.
ignore - The list of targetes relevant to the actual target.
dummy - The relevant time span in ms.

isCompleted

public boolean isCompleted(ParameterClustering set,
                           TargetDefinition target)
Test, if this target is completed. In terms of a terminal merit, this means checking if the current time is after the terminal time. In the latter case, i.e. when the actual merit is zero, true is returned.

Specified by:
isCompleted in interface EndpointDefining