| java.lang.Object org.cougaar.glm.plugins.BasicProcessor
All known Subclasses: org.cougaar.glm.plugins.inventory.InventoryProcessor, org.cougaar.glm.plugins.projection.GenerateDemandExpander, org.cougaar.mlm.construction.ConstructionGenerateDemandProjector,
BasicProcessor | abstract public class BasicProcessor (Code) | | BasicProcessor supplies generic methods for connecting to the 'owner'
plugin and to record objects as they are published by this processor
to the logplan.
See Also: DecorationPlugin See Also: PluginDecorator |
Method Summary | |
public String | arDesc(AllocationResult ar) | public AllocationResult | buildExpansionResult(Expansion expansion) | public AllocationResult | buildExpansionResult(Expansion expansion, boolean like_tasks) | public NewTask | buildNewTask(Task input_task, String output_verb, Asset direct_object) | public Task | buildTask(Task input_task, String output_verb, Asset direct_object, PrepositionalPhrase pp) | public Task | buildTask(Task input_task, String output_verb, Asset direct_object, Vector preposition_phrases) | public Task | buildTask(Task input_task, String output_verb, Asset direct_object, Vector preposition_phrases, Preference pref) | public Task | buildTask(Task input_task, String output_verb, Asset direct_object, Vector preposition_phrases, Enumeration prefs) | public Task | buildTask(Task input_task, String output_verb, Asset direct_object, Enumeration prefs) | public Workflow | buildWorkflow(Task parent, Vector subtasks) Build a workflow from a vector of tasks. | public Workflow | buildWorkflow(Task parent, Task task) Build a workflow with a single task. | protected Task | changeTask(Task prev_task, Task new_task) Create String defining task identity. | public Preference | createDateAfterPreference(int aspect, long value) | public Preference | createDateBeforePreference(int aspect, long value) | public AllocationResult | createEstimatedAllocationResult(Task t) | public Preference | createPreference(int aspect, double value) | public Preference | createQuantityPreference(int aspect, double value) | protected Enumeration | diffProjections(Schedule published_schedule, Schedule newtask_schedule) Reconcile an intended schedule of projections with the
currently published schedule of projections so as to reuse as
many of the existing projection tasks as possible.
Generally as elements from the published schedule are used they
are removed from the schedule. | public long | getAlpTime() | public boolean | isSubscriptionChanged(IncrementalSubscription sub) | public static Schedule | newObjectSchedule(Enumeration tasks) | public PrepositionalPhrase | newPrepositionalPhrase(String preposition, Object io) | public PrepositionalPhrase | newPrepositionalPhrase(String preposition) | public NewWorkflow | newWorkflow(Task parent) | protected String | printProjection(String msg, Task task) | protected void | publishAddTask(Task task) | protected boolean | publishAllocation(Task task, Asset asset, org.cougaar.planning.ldm.plan.Role role) | protected boolean | publishAllocation(Task task, Asset asset, Role role, AllocationResult ar) | protected boolean | publishAllocation(Task task, Asset asset, Role role, AllocationResult ar, boolean needAR) | protected void | publishAsset(Asset asset) | protected void | publishChangeAsset(Asset asset) | protected void | publishChangeTask(Task task) | protected void | publishExpansion(Task parent, Vector tasks) The goal of this code is to replace any existing expansion of
the parent into the new set of subtasks, but to do so in a way
that maximizes the reuse of existing subtasks of the parent.
This is done by putting all the existing subtasks into a
hashtable using a key characterizing the ways that the subtask
cannot be changed (verb, etc.). | protected void | publishFailedDisposition(Task task, AllocationResult ar) | protected void | publishRemoveAllocation(Allocation alloc) | protected void | publishRemoveAsset(Asset asset) | protected void | publishRemoveExpansion(Expansion exp) | protected void | publishRemoveTask(Task task) | public String | qseString(QuantityScheduleElement qse) | protected void | setEndTimePreference(NewTask task, long end) | protected void | setStartTimePreference(NewTask task, long start) | protected IncrementalSubscription | subscribe(UnaryPredicate predicate) | protected String | taskKey(Task t) Create String defining task identity. | abstract public void | update() | public void | updateAllocationResult(PlanElement pe) | protected void | updateExpansionResult(Enumeration planelements) When the published sub-tasks of an expansion get the allocation result updated,
try to update the allocation result on the whole expansion. |
MSEC_PER_DAY | final protected static long MSEC_PER_DAY(Code) | | number of msec per day
|
MSEC_PER_HOUR | final protected static long MSEC_PER_HOUR(Code) | | |
MSEC_PER_MIN | final protected static long MSEC_PER_MIN(Code) | | |
buildWorkflow | public Workflow buildWorkflow(Task parent, Vector subtasks)(Code) | | Build a workflow from a vector of tasks.
Parameters: parent - parent task of workflow Parameters: subtasks - workflow tasks Workflow |
buildWorkflow | public Workflow buildWorkflow(Task parent, Task task)(Code) | | Build a workflow with a single task.
Parameters: parent - parent task of workflow Parameters: task - single workflow task Workflow |
changeTask | protected Task changeTask(Task prev_task, Task new_task)(Code) | | Create String defining task identity. Defaults to comparing preferences.
Parameters: prev_task - previously published task. Parameters: new_task - already defined to have the same taskKey as task a. null if the two tasks are the same,or returns task a modified for a publishChange. See Also: BasicProcessor.taskKey(Task t) |
createDateAfterPreference | public Preference createDateAfterPreference(int aspect, long value)(Code) | | |
createDateBeforePreference | public Preference createDateBeforePreference(int aspect, long value)(Code) | | |
createEstimatedAllocationResult | public AllocationResult createEstimatedAllocationResult(Task t)(Code) | | create an AllocationResult that assumes the 'best' possible result
(taken from GLSAllocatorPlugin)
|
createPreference | public Preference createPreference(int aspect, double value)(Code) | | Create a preference with the Strict scoring function at 'value' for the
given aspect type
|
createQuantityPreference | public Preference createQuantityPreference(int aspect, double value)(Code) | | Create a preference with the scoring NearOrAbove function at 'value' for the
given aspect type
|
diffProjections | protected Enumeration diffProjections(Schedule published_schedule, Schedule newtask_schedule)(Code) | | Reconcile an intended schedule of projections with the
currently published schedule of projections so as to reuse as
many of the existing projection tasks as possible.
Generally as elements from the published schedule are used they
are removed from the schedule. Tasks remaining in the schedule
are rescinded.
There are three regions of interest: before now, around now and
after now. These are each handled separately. In the region
before now, already published tasks are unconditionally
retained and new tasks are unconditionally ignored.
In the region around now, tasks may start before now and end
after. If both a published task and a new task spanning now
exist, then there are two cases: If the demand rates are the
same, then the published task is changed to look like the new
task (by changing its end time preference). The start time of
the published task is unchanged. Think of the existing task
ending now and the new task starting now and then splicing the
two together into one task. If the rates are different, then
the existing task must end when the new task starts. The
current code accomplishes this by setting the end time
preference of the existing task to the start time of the new.
This is not exactly correct since we shouldn't change the past.
The times of the tasks should be no less than now.
In the region after now, we try to match up the tasks. When a
match is possible, the existing task is changed if necessary
(and republished) otherwise it is rescinded and the new task
added.
|
getAlpTime | public long getAlpTime()(Code) | | |
newWorkflow | public NewWorkflow newWorkflow(Task parent)(Code) | | Initialize workflow parent task and sets propagating
Parameters: parent - parent task of workflow NewWorkflow with parent task an propagating set |
publishAddTask | protected void publishAddTask(Task task)(Code) | | |
publishAsset | protected void publishAsset(Asset asset)(Code) | | |
publishChangeAsset | protected void publishChangeAsset(Asset asset)(Code) | | |
publishChangeTask | protected void publishChangeTask(Task task)(Code) | | |
publishExpansion | protected void publishExpansion(Task parent, Vector tasks)(Code) | | The goal of this code is to replace any existing expansion of
the parent into the new set of subtasks, but to do so in a way
that maximizes the reuse of existing subtasks of the parent.
This is done by putting all the existing subtasks into a
hashtable using a key characterizing the ways that the subtask
cannot be changed (verb, etc.). Then the new tasks are matched
against the old. Where matches are found the existing task is
adjusted to match. IF a new task cannot be matched, it is added
to the expansion. After matching is completed, any old tasks
that were not matched are removed from the expansion.
|
publishRemoveAllocation | protected void publishRemoveAllocation(Allocation alloc)(Code) | | |
publishRemoveAsset | protected void publishRemoveAsset(Asset asset)(Code) | | |
publishRemoveExpansion | protected void publishRemoveExpansion(Expansion exp)(Code) | | |
publishRemoveTask | protected void publishRemoveTask(Task task)(Code) | | |
setEndTimePreference | protected void setEndTimePreference(NewTask task, long end)(Code) | | |
setStartTimePreference | protected void setStartTimePreference(NewTask task, long start)(Code) | | |
taskKey | protected String taskKey(Task t)(Code) | | Create String defining task identity.
Parameters: t - task String defining task identity. |
update | abstract public void update()(Code) | | |
updateExpansionResult | protected void updateExpansionResult(Enumeration planelements)(Code) | | When the published sub-tasks of an expansion get the allocation result updated,
try to update the allocation result on the whole expansion.
Do not update the allocation result until all subtasks have been updated.
|
|
|