| org.cougaar.lib.vishnu.client.VishnuPlugin org.cougaar.lib.vishnu.client.VishnuAllocatorPlugin
All known Subclasses: org.cougaar.lib.vishnu.client.custom.CustomVishnuAllocatorPlugin,
VishnuAllocatorPlugin | public class VishnuAllocatorPlugin extends VishnuPlugin implements UTILAllocatorPlugin(Code) | | Vishnu plugin that takes Vishnu assignments and creates allocations out of them
|
Method Summary | |
protected UTILAllocationCallback | createAllocCallback() Override to replace with a callback that has a different predicate
or different behaviour when triggered. | protected PlanElement | createAllocation(Task task, Asset asset, Date start, Date end, double confidence, Role role, double quantity) Creates an allocation or dispostion if the start and end times
violate the preferences. | protected UTILFilterCallback | createThreadCallback(UTILGenericListener bufferingThread)
Callback for input tasks
Provide the callback that is paired with the buffering thread, which is a
listener. | protected UTILAllocationCallback | getAllocCallback() | protected double | getConfidence(Asset asset)
By default, sets highest confidence on allocation. | protected Role | getRole() Transporter by default, override to use a different role
Specifies role in the allocation plan element. | protected UTILFilterCallback | getWorkflowCallback() | public void | handleAssignment(org.cougaar.planning.ldm.plan.Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd, String contribs, String taskText) Makes allocations given the task to asset assignment. | public void | handleIllFormedTask(Task t) Implemented for UTILBufferingPlugin
Got an ill-formed task, now handle it, by
publishing a failed plan allocation for the task. | public void | handleRemovedAlloc(Allocation alloc)
Called when an allocation is removed from the cluster.
I.e. | public boolean | handleRescindedAlloc(Allocation alloc)
Implemented for UTILAllocationListener
Defines re-allocation of a rescinded task. | public void | handleSuccessfulAlloc(Allocation alloc)
Implemented for UTILAllocationListener
Called automatically by the UTILAllocationCallback
if the allocation has changed but it does NOT need
to be rescinded. | public boolean | interestingNotification(Task t) Implemented for UTILAllocationListener
OVERRIDE to specify task notifications (i.e. | public boolean | needToRescind(Allocation alloc)
Implemented for UTILAllocationListener
Defines conditions for rescinding tasks.
Only return true if the plugin can do something different
with the task that failed. | public void | publishRemovalOfAllocation(Allocation alloc)
Implemented for UTILAllocationListener
Public version of publishRemove
Called by UTILAllocationCallback.reactToChangedAlloc. | public void | setupFilters()
The idea is to add subscriptions (via the filterCallback), and when
they change, to have the callback react to the change, and tell
the listener (many times the plugin) what to do. |
createAllocCallback | protected UTILAllocationCallback createAllocCallback()(Code) | | Override to replace with a callback that has a different predicate
or different behaviour when triggered.
|
createAllocation | protected PlanElement createAllocation(Task task, Asset asset, Date start, Date end, double confidence, Role role, double quantity)(Code) | | Creates an allocation or dispostion if the start and end times
violate the preferences.
Parameters: task - task being assigned to asset Parameters: asset - asset handling the task Parameters: start - start of the task Parameters: end - end of the task Parameters: confidence - of the allocation Parameters: role - of the allocation Allocation or Disposition |
createThreadCallback | protected UTILFilterCallback createThreadCallback(UTILGenericListener bufferingThread)(Code) | |
Callback for input tasks
Provide the callback that is paired with the buffering thread, which is a
listener. The buffering thread is the listener to the callback
Creates an instance of the WorkflowCallback, which means the plugin
is looking for tasks that are part of workflows.
Parameters: bufferingThread - -- the thread the callback informs when there are new input tasks a WorkflowCallback with the buffering thread as its listener |
getConfidence | protected double getConfidence(Asset asset)(Code) | |
By default, sets highest confidence on allocation.
This is usually only appropriate for allocation to Physical Assets.
If your allocator allocates to organizations, you probably want to override
this function and set the confidence to alloc.MEDIUM_CONFIDENCE.
Or you could do :
double confidence = ((GLMAsset) asset).hasPhysicalPG () ?
alloc.HIGHEST_CONFIDENCE : alloc.MEDIUM_CONFIDENCE;
|
getRole | protected Role getRole()(Code) | | Transporter by default, override to use a different role
Specifies role in the allocation plan element.
|
handleAssignment | public void handleAssignment(org.cougaar.planning.ldm.plan.Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd, String contribs, String taskText)(Code) | | Makes allocations given the task to asset assignment.
If the task has a setup or wrapup duration, and expansion is made and
then the subtasks get allocated with the setup and wrapup durations.
Calls createAllocation to create the allocation of
task to asset, and makeSetupAndWrapupTasks to create the
optional setup and wrapup tasks. createAllocation is called
using getConfidence and getRole .
See Also: VishnuAllocatorPlugin.createAllocation See Also: VishnuAllocatorPlugin.makeSetupAndWrapupTasks Parameters: task - task being assigned to asset Parameters: asset - asset handling the task Parameters: start - start of the main task Parameters: end - end of the main task Parameters: setupStart - start of a setup task, equal to start if there is no setup task Parameters: wrapupEnd - end of a wrapup task, equal to end if there is no wrapup task |
handleIllFormedTask | public void handleIllFormedTask(Task t)(Code) | | Implemented for UTILBufferingPlugin
Got an ill-formed task, now handle it, by
publishing a failed plan allocation for the task.
Parameters: t - badly-formed task to handle |
interestingNotification | public boolean interestingNotification(Task t)(Code) | | Implemented for UTILAllocationListener
OVERRIDE to specify task notifications (i.e. changed
(allocations) the plugin is interested in.
Just calls interestingTask by default, which is generally
what you want.
Parameters: t - task to check for notification boolean true if task is interesting |
setupFilters | public void setupFilters()(Code) | |
The idea is to add subscriptions (via the filterCallback), and when
they change, to have the callback react to the change, and tell
the listener (many times the plugin) what to do.
Override and call super to add new filters, or override
createXXXCallback to change callback behaviour.
By default adds allocation callback after creating it.
See Also: VishnuAllocatorPlugin.createAllocCallback |
Methods inherited from org.cougaar.lib.vishnu.client.VishnuPlugin | protected void appendGlobalDataFormat(Document problemFormatDoc)(Code)(Java Doc) protected void attachAssociatedFiles(Document problemFormatDoc)(Code)(Java Doc) public void clearChangedAssets()(Code)(Java Doc) protected void clearTasks()(Code)(Java Doc) protected UTILAssetCallback createAssetCallback()(Code)(Java Doc) protected SchedulerLifecycle createDirectMode()(Code)(Java Doc) protected DirectResultHandler createDirectResultHandler()(Code)(Java Doc) protected SchedulerLifecycle createExternalMode()(Code)(Java Doc) protected SchedulerLifecycle createInternalMode()(Code)(Java Doc) protected Task createMainTask(Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd)(Code)(Java Doc) protected Task createSetupTask(Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd)(Code)(Java Doc) protected VishnuComm createVishnuComm()(Code)(Java Doc) protected VishnuConfig createVishnuConfig()(Code)(Java Doc) protected VishnuDomUtil createVishnuDomUtil()(Code)(Java Doc) protected Task createWrapupTask(Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd)(Code)(Java Doc) protected XMLProcessor createXMLProcessor()(Code)(Java Doc) protected XMLResultHandler createXMLResultHandler()(Code)(Java Doc) protected Collection getAllAssets()(Code)(Java Doc) protected UTILAssetCallback getAssetCallback()(Code)(Java Doc) public Asset getAssetForKey(StringKey key)(Code)(Java Doc) public Collection getChangedAssets()(Code)(Java Doc) public XMLizer getDataXMLizer()(Code)(Java Doc) public int getNumAssets()(Code)(Java Doc) public int getNumTasks()(Code)(Java Doc) protected Vector getPreferences(Task parentTask, Date readyAt, Date earliest, Date best, Date latest)(Code)(Java Doc) protected Vector getPrepPhrases(Task parentTask, Asset a)(Code)(Java Doc) public boolean getRunDirectly()(Code)(Java Doc) public Task getTaskForKey(StringKey key)(Code)(Java Doc) public String getTaskName()(Code)(Java Doc) public Collection getTasks()(Code)(Java Doc) public void handleAssignment(org.cougaar.planning.ldm.plan.Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd, String contribs, String taskText)(Code)(Java Doc) public void handleChangedAssets(Enumeration changedAssets)(Code)(Java Doc) public void handleIllFormedTask(Task t)(Code)(Java Doc) protected void handleImpossibleTasks(Collection impossibleTasks)(Code)(Java Doc) public void handleMultiAssignment(Vector tasks, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd, boolean assetWasUsedBefore)(Code)(Java Doc) public void handleNewAssets(Enumeration newAssets)(Code)(Java Doc) protected void handleRemovedTasks(Enumeration removedTasks)(Code)(Java Doc) protected void initializeWithStoredFormat()(Code)(Java Doc) public boolean interestingAsset(Asset a)(Code)(Java Doc) public boolean interestingTask(Task t)(Code)(Java Doc) public void localSetup()(Code)(Java Doc) protected List makeSetupWrapupExpansion(Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd)(Code)(Java Doc) protected void prepareData(List stuffToSend, Document objectFormatDoc)(Code)(Java Doc) protected void prepareObjectFormat(List tasks)(Code)(Java Doc) protected Document prepareStoredObjectFormat()(Code)(Java Doc) public void prepareVishnuObjects(List tasksAndResources, Collection changedAssets, List vishnuTasks, List vishnuResources, List changedVishnuResources, Document objectFormat, SchedulingData schedData)(Code)(Java Doc) public void processTasks(List tasks)(Code)(Java Doc) protected void publishAddWithCheck(Object obj)(Code)(Java Doc) public void publishSubtasks(boolean wantConfidence, Task t, List subtasks)(Code)(Java Doc) public void removeTask(StringKey key)(Code)(Java Doc) protected Map sendFormat(Collection templates, String assetClassName)(Code)(Java Doc) protected void setUIDToObjectMap(Collection objects, Map UIDtoObject)(Code)(Java Doc) public void setupFilters()(Code)(Java Doc) protected void unfreezeTasks(Collection tasks)(Code)(Java Doc) protected void waitForAnswer()(Code)(Java Doc)
|
|
|