public class ModulusMerit extends AbstractMerit implements Initializable
KEY_T0, or, if unspecified, the first successful observation is
used. Before t0, KEY_BEFOREMERIT is returned, which defaults to zero
in case a t0 has been specified and one if no t0 is stated. Once t0 has been
passed, the merit stays at one for KEY_ONPERIOD days, then it drops
to
zero for KEY_OFFPERIOD days. Both properties can define lists, like
5,3,1
and 1,3,5 which would mean 5 nights on, one off, three nights on, three
nights off, one night on, five nights off. Then the pattern is repeated ad
infinitum.| Modifier and Type | Field and Description |
|---|---|
private double |
cycle
An entire cycle of on and offs.
|
private static String |
DEFTIME
Default time parameter name.
|
static String |
KEY_BEFOREMERIT
The key linked to the merit rises before t0 or first pick..
|
static String |
KEY_OFFPERIOD
The key to the on-periods, in days.
|
static String |
KEY_ONPERIOD
The key to the on-periods, in days.
|
static String |
KEY_T0
The t0, if unspecified first successful observation.
|
static String |
KEY_TIME
The key pointing to the name of the time parameter.
|
private List<Double> |
off
The off periods.
|
private List<Double> |
on
The on periods.
|
private static long |
serialVersionUID |
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASS| Constructor and Description |
|---|
ModulusMerit(Map<String,String> prop)
Constructs a at-time merit starting at the current time and with a
default risetime (
#DEFRISE) and sharpness (#DEFSHARP . |
| Modifier and Type | Method and Description |
|---|---|
double |
getMerit(GlobalGrouping set,
Appointable target,
Collection<Appointable> ignore,
long spms)
Calculates the actual time slot merit.
|
void |
init() |
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, toStringprivate static final long serialVersionUID
public static final String KEY_BEFOREMERIT
public static final String KEY_T0
public static final String KEY_ONPERIOD
public static final String KEY_OFFPERIOD
public static final String KEY_TIME
private static final String DEFTIME
private double cycle
public ModulusMerit(Map<String,String> prop)
#DEFRISE) and sharpness (#DEFSHARP .
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 void init()
init in interface Initializablepublic double getMerit(GlobalGrouping set, Appointable target, Collection<Appointable> ignore, long spms)