public class NumberMerit extends AbstractMerit implements EndpointDefining
g(t)=k·(π/2-arctan(N/width)·2/π),where N is the number of successful observations, k is a scaling factor and
width is a stretching parameter. Though the merit never
get zero, one can define a KEY_TERMINAL property, which forces
the merit to be zero once this number of successful observations has been
surpassed, thus it is EndpointDefining.| Modifier and Type | Field and Description |
|---|---|
private static double |
DEFIMPACT
Default value for the priority impact.
|
private static int |
DEFTERMINAL
Default value for the maximum number of observations.
|
private static double |
DEFWIDTH
Default value of the merit width.
|
static String |
KEY_IMPACT
The key linked to the impact of the merit.
|
static String |
KEY_TERMINAL
The key linked to the maximum number of successful observations.
|
static String |
KEY_WIDTH
The key linked to the width of the merit.
|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASS| Constructor and Description |
|---|
NumberMerit(Map prop)
Constructs a number merit, defaulting the
KEY_IMPACT
and the KEY_WIDTH
parameters. |
| Modifier and Type | Method and Description |
|---|---|
double |
getMerit(GlobalGrouping set,
Appointable target,
Collection ignore,
long dummy)
Calculates the actual time slot merit.
|
boolean |
isCompleted(GlobalGrouping set,
Appointable target)
Returns true, if the number of successful observations has reached the
requested value.
|
createMerit, getInitializer, initMeritaugment, augment, augment, augment, augment, clone, 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, initProperties, isNew, parseObject, parseObject, reload, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringpublic static final String KEY_IMPACT
public static final String KEY_WIDTH
public static final String KEY_TERMINAL
private static final double DEFIMPACT
private static final double DEFWIDTH
private static final int DEFTERMINAL
public NumberMerit(Map prop)
KEY_IMPACT
and the KEY_WIDTH
parameters. Proper creation should be
done using the
AbstractMerit.createMerit(java.util.Map<java.lang.String, java.lang.String>)
method. This create method also takes care of proper parameter
overloading.public double getMerit(GlobalGrouping set, Appointable target, Collection ignore, long dummy)
#KEY_MAXOBSERVATIONS, the
KEY_IMPACT merit is returned. If the target definition is not
history aware, one is returned. public boolean isCompleted(GlobalGrouping set, Appointable target)
isCompleted in interface EndpointDefining