public class ForcedSwitchOnMerit extends AbstractMerit
KEY_SWITCH is true and has been
toggled to true at least KEY_ONFOR milliseconds.| Modifier and Type | Field and Description |
|---|---|
private static long |
DEFONFOR
Default time the switch must have been on, ms.
|
static String |
KEY_ONFOR
The time that must have been passed since the last switch-on.
|
static String |
KEY_SWITCH
The key linked to the name of the switch that must be on.
|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASS| Constructor and Description |
|---|
ForcedSwitchOnMerit(Map prop)
Constructs a time-out merit.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getMerit(GlobalGrouping set,
Appointable dummy,
Collection ignore,
long within)
Calculates the actual time slot merit.
|
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_SWITCH
public static final String KEY_ONFOR
private static final long DEFONFOR
public ForcedSwitchOnMerit(Map prop)
KEY_ONFOR
parameter. 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 dummy, Collection ignore, long within)
KEY_SWITCH is on for at least KEY_ONFOR milliseconds
we return one. If the switch is unknown, we return zero.set - Current observing conditions.dummy - The actual target.ignore - All targets, observable or not.within - The relevant time span in ms.