stella.xml
Class AfterPickMerit

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.AbstractMerit
                  extended by stella.xml.AfterPickMerit
All Implemented Interfaces:
Serializable, Cloneable, EndpointDefining, Meriting, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying
Direct Known Subclasses:
ConsecutiveMerit, FollowingProgramMerit, SuccessorCloseMerit, SuccessorMerit

public abstract class AfterPickMerit
extends AbstractMerit
implements EndpointDefining

This merit represents a merit that grows/shrinks after a first successful observation of a target. Until the target has been observed for the first time, the merit is one, indicating its use as a timeslot. The merit is fitted with a two-order polynom such has a value of k at t=t0, from t0 it rises within a time m to its peak value (m may also be negative, then the merit drops as soon as the target was picked). After a time z the merit drops to zero, where it stays (EndpointDefining). This behaviour implies that k is non-negative, m is arbitrary, z is non-negative and z>2m. The polynom used is

   merit(t)=k[(t-t0)²/z(2m-z)+2m(t-t0)/z(z-2m)+1]
   
The definition of t0 and the flavor of the merit is different in its three non-abstract subclasses SuccessorMerit, ConsecutiveMerit, and FollowingProgramMerit. To allow a time-independant merit, set zero to a high value. In particular, setting zero to a value less equal zero renders z to be positive infinitive.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  double apoly
          To easy evaluation, calculate polynom at construct.
private  double bpoly
          To easy evaluation, calculate polynom at construct.
private static double DEFMAXIMUMDAY
          The default rise-time to the maximum.
private static double DEFSCALE
          The default scale.
private static String DEFTIME
          The default name of the time parameter.
static String KEY_FLAVOR
          The key linked to the 'flavor' of the merit.
static String KEY_MAXIMUM
          The rise-time to the maximum, same unit as the time.
static String KEY_MAXIMUMDAY
          The rise-time to the maximum, same unit as the time.
static String KEY_SCALE
          The key linked to the scaling factor k of the merit.
static String KEY_TIME
          The name of the time parameter.
static String KEY_ZERO
          The time down to zero.
static String KEY_ZERODAY
          The time down to zero.
private  double m
          The time to raise tio the maximum.
private  double z
          The time 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
AfterPickMerit(Map prop)
          Constructs a new after-start merit.
 
Method Summary
protected abstract  double checkForStartTime(TargetDefinition me, Collection others, ParameterClustering set)
          Checks for the starting time.
 double getMerit(ParameterClustering needtime, TargetDefinition aim, Collection oftargets, long within)
          Calculates the merit.
 boolean isCompleted(ParameterClustering set, TargetDefinition aim)
          Test, if the first successful observation has been done too long in the past.
 
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_SCALE

public static final String KEY_SCALE
The key linked to the scaling factor k of the merit.

See Also:
Constant Field Values

KEY_FLAVOR

public static final String KEY_FLAVOR
The key linked to the 'flavor' of the merit. Either zero or one.

See Also:
Constant Field Values

KEY_MAXIMUM

public static final String KEY_MAXIMUM
The rise-time to the maximum, same unit as the time.

See Also:
Constant Field Values

KEY_MAXIMUMDAY

public static final String KEY_MAXIMUMDAY
The rise-time to the maximum, same unit as the time.

See Also:
Constant Field Values

KEY_ZERO

public static final String KEY_ZERO
The time down to zero.

See Also:
Constant Field Values

KEY_ZERODAY

public static final String KEY_ZERODAY
The time down to zero.

See Also:
Constant Field Values

KEY_TIME

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

See Also:
Constant Field Values

DEFSCALE

private static final double DEFSCALE
The default scale.

See Also:
Constant Field Values

DEFMAXIMUMDAY

private static final double DEFMAXIMUMDAY
The default rise-time to the maximum.

See Also:
Constant Field Values

DEFTIME

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

See Also:
Constant Field Values

apoly

private double apoly
To easy evaluation, calculate polynom at construct. Quadratic factor.


bpoly

private double bpoly
To easy evaluation, calculate polynom at construct. Linear factor.


z

private double z
The time to drop to zero.


m

private double m
The time to raise tio the maximum.

Constructor Detail

AfterPickMerit

public AfterPickMerit(Map prop)
Constructs a new after-start merit. The zero-time must be specified.

Method Detail

getMerit

public double getMerit(ParameterClustering needtime,
                       TargetDefinition aim,
                       Collection oftargets,
                       long within)
Calculates the merit. If the target has never been successfully picked, the entry value is returned. If the first successful pick was longer than KEY_ZERO time in the past, zero is returned. In the intermittant phase return a merit that rises from the scale factor until some KEY_MAXIMUM time is passed, then drops to zero.

Specified by:
getMerit in interface Meriting
Parameters:
needtime - Current observing conditions.
aim - The actual target.
oftargets - The list of targetes relevant to the actual target.
within - The relevant time span in ms.

isCompleted

public boolean isCompleted(ParameterClustering set,
                           TargetDefinition aim)
Test, if the first successful observation has been done too long in the past.

Specified by:
isCompleted in interface EndpointDefining

checkForStartTime

protected abstract double checkForStartTime(TargetDefinition me,
                                            Collection others,
                                            ParameterClustering set)
Checks for the starting time. May be dependend on this target or even on the list of other targets.