Java Doc for VishnuAllocatorPlugin.java in  » Science » Cougaar12_4 » org » cougaar » lib » vishnu » client » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Cougaar12_4 » org.cougaar.lib.vishnu.client 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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


Field Summary
protected  UTILAllocationCallbackmyAllocCallback
    
protected  UTILWorkflowCallbackmyWorkflowCallback
    


Method Summary
protected  UTILAllocationCallbackcreateAllocCallback()
     Override to replace with a callback that has a different predicate or different behaviour when triggered.
protected  PlanElementcreateAllocation(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  UTILFilterCallbackcreateThreadCallback(UTILGenericListener bufferingThread)
    
 Callback for input tasks 
 Provide the callback that is paired with the buffering thread, which is a
 listener.
protected  UTILAllocationCallbackgetAllocCallback()
    
protected  doublegetConfidence(Asset asset)
    
 By default, sets highest confidence on allocation.
protected  RolegetRole()
     Transporter by default, override to use a different role Specifies role in the allocation plan element.
protected  UTILFilterCallbackgetWorkflowCallback()
    
public  voidhandleAssignment(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  voidhandleIllFormedTask(Task t)
     Implemented for UTILBufferingPlugin

Got an ill-formed task, now handle it, by
publishing a failed plan allocation for the task.

public  voidhandleRemovedAlloc(Allocation alloc)
    
 Called when an allocation is removed from the cluster.
 I.e.
public  booleanhandleRescindedAlloc(Allocation alloc)
    
 Implemented for UTILAllocationListener
 Defines re-allocation of a rescinded task.
public  voidhandleSuccessfulAlloc(Allocation alloc)
    
 Implemented for UTILAllocationListener
 Called automatically by the UTILAllocationCallback 
 if the allocation has changed but it does NOT need 
 to be rescinded.
public  booleaninterestingNotification(Task t)
     Implemented for UTILAllocationListener

OVERRIDE to specify task notifications (i.e.

public  booleanneedToRescind(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  voidpublishRemovalOfAllocation(Allocation alloc)
    
 Implemented for UTILAllocationListener
 Public version of publishRemove
 Called by UTILAllocationCallback.reactToChangedAlloc.
public  voidsetupFilters()
    
 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.

Field Detail
myAllocCallback
protected UTILAllocationCallback myAllocCallback(Code)
callback handling/monitoring outgoing allocation



myWorkflowCallback
protected UTILWorkflowCallback myWorkflowCallback(Code)
callback handling/monitoring incoming tasks





Method Detail
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



getAllocCallback
protected UTILAllocationCallback getAllocCallback()(Code)



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.



getWorkflowCallback
protected UTILFilterCallback getWorkflowCallback()(Code)



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. createAllocationis 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




handleRemovedAlloc
public void handleRemovedAlloc(Allocation alloc)(Code)
 Called when an allocation is removed from the cluster.
 I.e. an upstream cluster removed an allocation, and that 
 rescind has resulted in this allocation being removed.
 If the plugin maintains some local state of the availability
 of assets, it should update them here.
 This is different from the needToRescind-handleRescindedAlloc pair
 which are used when the plugin gets a result that it wants to
 replan.  If needToRescind returns true, a downstream
 cluster will see handleRemovedAlloc get called.
 Calls VishnuPlugin.handleRemovedTasks.  If in incremental mode,
 the SchedulerLifecycle Mode will tell the scheduler to forget about
 the removed task.
 

Parameters:
  alloc - that was removed from the blackboard
See Also:   org.cougaar.lib.vishnu.client.VishnuPlugin.handleRemovedTasks
See Also:   org.cougaar.lib.vishnu.client.InternalMode.handleRemovedTasks
See Also:   org.cougaar.lib.vishnu.client.ExternalMode.handleRemovedTasks



handleRescindedAlloc
public boolean handleRescindedAlloc(Allocation alloc)(Code)
 Implemented for UTILAllocationListener
 Defines re-allocation of a rescinded task.  
 Overriders need to take into consideration that 
 the asset chosen last time is not available this time.
 Note that updateAllocationResult is called automatically by
 the UTILAllocationCallback if the allocation has changed 
 (typically if its allocation result has changed) 
 but it does NOT need to be rescinded.
 Called by UTILAllocationCallback.reactToChangedAlloc.
 Only called when needToRescind returns TRUE.
 See comment on needToRescind.
 Does nothing by default.
 

Parameters:
  alloc - the allocation that should be rescinded false since doesn't rescind the allocation
See Also:   org.cougaar.lib.filter.UTILPluginAdapter.updateAllocationResult
See Also:   org.cougaar.lib.callback.UTILAllocationListener.updateAllocationResult
See Also:   org.cougaar.lib.callback.UTILAllocationCallback.reactToChangedAlloc
See Also:   VishnuAllocatorPlugin.needToRescind



handleSuccessfulAlloc
public void handleSuccessfulAlloc(Allocation alloc)(Code)
 Implemented for UTILAllocationListener
 Called automatically by the UTILAllocationCallback 
 if the allocation has changed but it does NOT need 
 to be rescinded. 
 updateAllocationResult is called first and then this method 
 gets called.
 Called by UTILAllocationCallback.reactToChangedAlloc.
 Only called when needToRescind returns FALSE.
 See comment on needToRescind.
 Does nothing by default.
 

Parameters:
  alloc - the allocation that was successful
See Also:   org.cougaar.lib.filter.UTILPluginAdapter.updateAllocationResult
See Also:   org.cougaar.lib.callback.UTILAllocationListener.updateAllocationResult
See Also:   org.cougaar.lib.callback.UTILAllocationCallback.reactToChangedAlloc
See Also:   VishnuAllocatorPlugin.needToRescind



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




needToRescind
public boolean needToRescind(Allocation alloc)(Code)
 Implemented for UTILAllocationListener
 Defines conditions for rescinding tasks.
 Only return true if the plugin can do something different 
 with the task that failed.  See allocHelper.isFailedPE.
 When returns TRUE, handleRescindedAlloc is called. 
 If in making an allocation, a preference
 threshold is exceeded, the returned plan element will be
 a Disposition (see UTILAllocate.makeAllocation ()).
 Called by UTILAllocationCallback.reactToChangedAlloc.
 

Parameters:
  alloc - the allocation to check boolean true if the allocation needs to be rescindedAlso returns false if there is no reported alloc resultattached to allocation
See Also:   VishnuAllocatorPlugin.handleRescindedAlloc
See Also:   org.cougaar.lib.callback.UTILAllocationCallback.reactToChangedAlloc
See Also:   org.cougaar.lib.util.UTILAllocate.makeAllocation
See Also:   org.cougaar.lib.util.UTILAllocate.isFailedPE



publishRemovalOfAllocation
public void publishRemovalOfAllocation(Allocation alloc)(Code)
 Implemented for UTILAllocationListener
 Public version of publishRemove
 Called by UTILAllocationCallback.reactToChangedAlloc.
 

Parameters:
  alloc - Allocation to remove from cluster's logPlan
See Also:   org.cougaar.lib.callback.UTILAllocationCallback.reactToChangedAlloc



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



Fields inherited from org.cougaar.lib.vishnu.client.VishnuPlugin
protected VishnuComm comm(Code)(Java Doc)
protected VishnuConfig config(Code)(Java Doc)
protected VishnuDomUtil domUtil(Code)(Java Doc)
protected int firstTemplateTasks(Code)(Java Doc)
protected boolean incrementalScheduling(Code)(Java Doc)
protected boolean localDidRehydrate(Code)(Java Doc)
protected boolean makeSetupAndWrapupTasks(Code)(Java Doc)
protected SchedulerLifecycle mode(Code)(Java Doc)
protected UTILAssetCallback myAssetCallback(Code)(Java Doc)
protected Map myAssetUIDtoObject(Code)(Java Doc)
protected Set myChangedAssets(Code)(Java Doc)
protected Set myNewAssets(Code)(Java Doc)
protected Map myTaskUIDtoObject(Code)(Java Doc)
protected Document objectFormatDoc(Code)(Java Doc)
protected ResultHandler resultHandler(Code)(Java Doc)
protected boolean runDirectly(Code)(Java Doc)
protected boolean runInternal(Code)(Java Doc)
protected boolean sentFormatAlready(Code)(Java Doc)
protected boolean showTiming(Code)(Java Doc)
protected AllocationResultAggregator skipTransitARA(Code)(Java Doc)
protected boolean stopOnFailure(Code)(Java Doc)
protected int total(Code)(Java Doc)
protected boolean useStoredFormat(Code)(Java Doc)
protected boolean wantMediumConfidenceOnExpansion(Code)(Java Doc)
protected XMLProcessor xmlProcessor(Code)(Java Doc)

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)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.