edu.mit.sketch.system
Class Scheduler
java.lang.Object
|
+--java.util.Observable
|
+--edu.mit.sketch.system.Scheduler
- Direct Known Subclasses:
- StageBasedScheduler
- public abstract class Scheduler
- extends Observable
The scheduler is in charge of choosing the next action from the
queue to execute. This is the base level class that must be
subclassed to choose a specific shceduling algorithm. A scheduler
has three types of object on the queue to choose from: a item, a
KS's conditions, or a KS's action.
Created: Wed Nov 21 15:25:02 2001
Copyright: Copyright (C) 2001 by MIT. All Rights Reserved.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_items
protected BBItemHandler m_items
- A collection of the new blackboard items that have appeared as a
result of the user's last input stroke or strokes.
m_system
protected BlackboardSystem m_system
- The whole information system including the knowledge sources and the
blackboard. This system does simple operations on the data flow,
like add new user inputs to the system and as the UI to display stuff
(Although this might be a job for the scheduler.)
m_blackboard
protected Blackboard m_blackboard
- The blackboard that holds all the knowledge in the system. This is
a convenience pointer since the blackboard can be accessed through
the blackboard system.
m_ksManager
protected KnowledgeSourceManager m_ksManager
- The ksIndex is responsible for figuring out which KS's are
relevent to which triggers. This is a part of the blackboard system
so we could just get it from there, but this is a conveneince pointer.
m_triggeredKSs
protected LinkedList m_triggeredKSs
Scheduler
public Scheduler(BlackboardSystem bbs)
readyToProcess
protected abstract boolean readyToProcess()
- Look at the new user inputs to the blackboard (in the BBItemHandler)
and decide whether they are worth processing at this stage.
doneProcessing
protected abstract boolean doneProcessing()
- Answer the question: are we done processing the input we have
and ready for more new user input?
chooseNextItem
protected abstract SchedulerItem chooseNextItem()
- Get the next item to be processed. This procedure may also
talk to the KS manager to see if there are more KSs that should be
run.
postProcessingStep
protected abstract SchedulerItem postProcessingStep()
- Ask if this particular scheduler has a post processing process to run.
addNewBBItem
public void addNewBBItem(BBItem bbItem)
getRecentItems
public Collection getRecentItems()
isStackEmpty
protected boolean isStackEmpty()
popStack
protected SchedulerItem popStack()
triggerKSs
protected void triggerKSs(Collection kss)
hasUnprocessed
protected boolean hasUnprocessed()