|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.AbstractScheduler
stella.xml.XMLScheduler
public class XMLScheduler
An implementation of the 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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private Collection<Meriting> |
globalmerit
A list of global merits like user merits. |
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. |
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. |
| 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.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
XMLScheduler(Map<String,String> sprop)
Constructs a new xml-scheduler. |
|
| Method Summary | |
|---|---|
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(ParameterClustering set,
Appointable dom,
Collection<TargetDefinition> 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. |
TargetDefinition |
getHighestTarget(ParameterClustering set,
Collection<TargetDefinition> targets)
Gets the target with the highest priority. |
protected static Appointable |
highestFromAll(ParameterClustering set,
Collection<TargetDefinition> all,
Collection<TargetDefinition> within,
Collection<Meriting> globalmerit)
A re-entrant method to find the highest target. |
private static Appointable |
highestWithin(ParameterClustering set,
Collection<TargetDefinition> targets,
Collection<TargetDefinition> observe,
long within,
Collection<Meriting> globalmerit)
Returns the target with the highest merit within the stated time. |
void |
init()
Initializes the scheduler. |
boolean |
removeMeritTrace(Appointable app)
We remove the name of the target from the list of merit tracing. |
private static Collection<TargetDefinition> |
retainTargets(ParameterClustering set,
Collection<TargetDefinition> observable,
long maxdur)
Retains all targets in the returned collection whose observing time is less then the stated threshold. |
| Methods inherited from class stella.AbstractScheduler |
|---|
addGlobalConstraint, checkGlobalConstraints, createScheduler, getGlobalConstraints, getObservableTargets, registerMonitor, removeAllGlobalConstraints, removeGlobalConstraint, wakeUp |
| 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, 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 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.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Field Detail |
|---|
public static final String KEY_GLOBALCONSTRAINT
public static final String KEY_GLOBALMERIT
public static final String KEY_GLOBALWATCH
private static int level
private Collection<Meriting> globalmerit
private List<String> meritinfo
| Constructor Detail |
|---|
public XMLScheduler(Map<String,String> sprop)
init() method.
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class PropertyResourcespublic boolean addMeritTrace(Appointable app)
public boolean removeMeritTrace(Appointable app)
private static Collection<TargetDefinition> retainTargets(ParameterClustering set,
Collection<TargetDefinition> observable,
long maxdur)
Appointables
private static Appointable highestWithin(ParameterClustering set,
Collection<TargetDefinition> targets,
Collection<TargetDefinition> 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 time
private static double getApparentMerit(ParameterClustering set,
Appointable dom,
Collection<TargetDefinition> targets,
long within,
Collection<Meriting> globalmerit)
public TargetDefinition getHighestTarget(ParameterClustering set,
Collection<TargetDefinition> targets)
protected static final Appointable highestFromAll(ParameterClustering set,
Collection<TargetDefinition> all,
Collection<TargetDefinition> within,
Collection<Meriting> globalmerit)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||