public class XMLScheduler extends AbstractScheduler
Scheduling interface. An xml
scheduler uses TargetDefinitions coming in the flavor of
DOMTargets. The scheduler is responsible for selecting the next
observation. This scheduler is a simple dispatch scheduler. The calculation
of the individual observation's merits is deferred to the target itself, see
ParsedTarget and the special subclasses of Meriting
for further details.PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private static boolean |
DEFALLOWNULL
Default no null return on non-null observables allowed.
|
private static int |
DEFMAXDEPTH
Default maximum depth.
|
private Collection<Meriting> |
globalmerit
A list of global merits like user merits.
|
static String |
KEY_ALLOWNULL
Set this to true to allow also returns of null on no convergence.
|
static String |
KEY_GLOBALCONSTRAINT
The key linked to the properties of the global constraints.
|
static String |
KEY_GLOBALMERIT
The key linked to the properties of the global timeslot.
|
static String |
KEY_GLOBALWATCH
The key to the objects watched during night for their merit.
|
static String |
KEY_MAXDEPTH
Maximum number of loops.
|
private static int |
level
For debugging purpose we record the re-entrant level.
|
private List<String> |
meritinfo
A list of targets whose merit is matched during night.
|
KEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
XMLScheduler(Map<String,String> sprop)
Constructs a new xml-scheduler.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addMeritTrace(Appointable app)
We add the name of the appointable target to the merit info list, which
means we will produce a log entry stating the current merit on any
instance the target was observable.
|
private static double |
getApparentMerit(GlobalGrouping set,
Appointable dom,
Collection<Appointable> targets,
long within,
Collection<Meriting> globalmerit)
Calculates the apparent merit a target has, which includes global
timeslots in addition to the target's own merit.
|
Appointable |
getHighestTarget(GlobalGrouping set,
Collection<Appointable> targets)
Gets the target with the highest priority.
|
private static SortedSet<TargetDefinition> |
getObservablesByPriority(Collection<Appointable> within) |
protected static Appointable |
highestFromAll(GlobalGrouping set,
Collection<Appointable> all,
Collection<Appointable> within,
Collection<Meriting> globalmerit,
int maxdepth)
A re-entrant method to find the highest target.
|
private static Pair<Appointable,Double> |
highestWithin(GlobalGrouping set,
Collection<Appointable> targets,
Collection<Appointable> observe,
long within,
Collection<Meriting> globalmerit)
Returns the target with the highest merit within the stated time.
|
void |
init()
Initializes the scheduler.
|
(package private) static Appointable |
oldHighestFromAll(GlobalGrouping set,
Collection<Appointable> all,
Collection<Appointable> within,
Collection<Meriting> globalmerit)
A re-entrant method to find the highest target.
|
boolean |
removeMeritTrace(Appointable app)
We remove the name of the target from the list of merit tracing.
|
private static Collection<Appointable> |
retainTargets(GlobalGrouping set,
Collection<Appointable> observable,
long maxdur)
Retains all targets in the returned collection whose observing time is
less then the stated threshold.
|
addGlobalConstraint, checkGlobalConstraints, createScheduler, getGlobalConstraints, getObservableTargets, registerMonitor, removeAllGlobalConstraints, removeGlobalConstraint, wakeUpclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdefaultBoolean, 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, stringPropertiespublic static final String KEY_GLOBALCONSTRAINT
public static final String KEY_GLOBALMERIT
public static final String KEY_GLOBALWATCH
public static final String KEY_ALLOWNULL
public static final String KEY_MAXDEPTH
private static final boolean DEFALLOWNULL
private static final int DEFMAXDEPTH
private static int level
private Collection<Meriting> globalmerit
public void init()
init in interface Initializableinit in class AbstractSchedulerpublic boolean addMeritTrace(Appointable app)
public boolean removeMeritTrace(Appointable app)
private static Collection<Appointable> retainTargets(GlobalGrouping set, Collection<Appointable> observable, long maxdur)
Appointablesprivate static Pair<Appointable,Double> highestWithin(GlobalGrouping set, Collection<Appointable> targets, Collection<Appointable> observe, long within, Collection<Meriting> globalmerit)
set - The parameters.targets - All targets, observable or not.observe - A collection of Appointables currently observablewithin - The proposed time span, zero for target observing timeprivate static double getApparentMerit(GlobalGrouping set, Appointable dom, Collection<Appointable> targets, long within, Collection<Meriting> globalmerit)
public Appointable getHighestTarget(GlobalGrouping set, Collection<Appointable> targets)
static final Appointable oldHighestFromAll(GlobalGrouping set, Collection<Appointable> all, Collection<Appointable> within, Collection<Meriting> globalmerit)
protected static final Appointable highestFromAll(GlobalGrouping set, Collection<Appointable> all, Collection<Appointable> within, Collection<Meriting> globalmerit, int maxdepth)
private static SortedSet<TargetDefinition> getObservablesByPriority(Collection<Appointable> within)