Java Doc for SequentialPlannerPlugin.java in  » Science » Cougaar12_4 » org » cougaar » logistics » plugin » trans » base » 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.logistics.plugin.trans.base 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.cougaar.lib.filter.UTILBufferingPluginAdapter
   org.cougaar.logistics.plugin.trans.base.SequentialPlannerPlugin

All known Subclasses:   org.cougaar.logistics.plugin.trans.SequentialGlobalAirPlugin,
SequentialPlannerPlugin
abstract public class SequentialPlannerPlugin extends UTILBufferingPluginAdapter implements UTILAllocationListener,UTILAssetListener,UTILExpansionListener(Code)
Base class that orchestrates sequential backwards planning. Handles the state transitions of each schedule element that makes up the schedule attached to each parent task.

Inner Class :class TaskCatcher implements UnaryPredicate

Field Summary
 MapchildToParentUID
    
protected  ListdelayedTasks
    
protected  UTILAllocationCallbackmyAllocCallback
    
protected  UTILAssetCallbackmyAssetCallback
    
protected  UTILExpansionCallbackmyExpansionCallback
    
protected  UTILExpandableTaskCallbackmyInputTaskCallback
    
 MaptaskToSSE
    
 booleantryToReplanOverlaps
    
protected  longwaitTime
    


Method Summary
protected  booleanallNecessaryAssetsReported()
    
protected  voidattachSubtask(Task subtask, SequentialScheduleElement spe)
     attachSubtask adds a created subtask to the parent task's expansion.
public  voidchangeExpansion(Expansion exp)
    
protected  UTILAllocationCallbackcreateAllocCallback()
    
protected  UTILAssetCallbackcreateAssetCallback()
    
abstract public  SchedulecreateEmptyPlan(Task parent)
     createEmptyPlan creates an empty schedule (there are no tasks yet in the workflow) made up of custom schedule elements.
protected  UTILExpansionCallbackcreateExpansionCallback()
    
protected  UTILFilterCallbackcreateThreadCallback(UTILGenericListener bufferingThread)
    
public  voidenterHash(String key, SequentialScheduleElement obj)
    
protected  voidexecute()
    
protected  UTILAllocationCallbackgetAllocCallback()
    
protected  UTILAssetCallbackgetAssetCallback()
    
final protected  IteratorgetAssets()
    
public  MapgetChildToParentUID()
    
protected  SequentialScheduleElementgetElement(Task child, Task parent, String uid)
     Finds the schedule element for the child task in the taskToSSE map.
protected  UTILExpansionCallbackgetExpansionCallback()
    
protected  UTILFilterCallbackgetInputTaskCallback()
    
public  TaskgetParentTask(Task child, String uid)
     Gets the parent task for the child task with the UID uid.
protected  ListgetPrunedTaskList(List tasks)
    
public  voidhandleChangedAssets(Enumeration e)
    
public  voidhandleConstraintViolation(Expansion exp, List violatedConstraints)
    
public  voidhandleFailedExpansion(Expansion exp, List failedSubTaskResults)
    
public  voidhandleIllFormedTask(Task t)
    
public  voidhandleNewAssets(Enumeration e)
    
public  voidhandleRemovedAlloc(Allocation alloc)
    
public  booleanhandleRescindedAlloc(Allocation alloc)
    
public  voidhandleSuccessfulAlloc(Allocation alloc)
     When an allocation is succesful you ignore it unless it is a meaningful allocation. Meaningful is defined as having a non-null reported result and a highest confidence rating. This would indicate that an allocation to an actual resource has been done.
public  voidhandleSuccessfulExpansion(Expansion exp, List successfulSubtasks)
    
public  voidhandleTask(Task t)
     handleTask creates an empty schedule and attaches it to the parent task.
public  booleaninterestingAsset(Asset a)
    
public  booleaninterestingExpandedTask(Task t)
    
public  booleaninterestingNotification(Task t)
    
public  booleaninterestingTask(Task t)
    
public  voidlocalSetup()
    
public  booleanneedToRescind(Allocation alloc)
    
public  voidprocessTasks(List tasks)
     If necessary subordinates have not reported yet, accumulates tasks into a delayedTasks list, and asks to be kicked again in 10 seconds, by which time hopefully the subordinates have reported.
public  PlanningFactorypublicGetFactory()
    
public  MessageAddresspublicGetMessageAddress()
    
public  StringpublicGetMyClusterName()
    
public  PlanpublicGetRealityPlan()
    
public  voidpublicPublishAdd(Object o)
    
public  voidpublicPublishChange(Object o)
    
public  voidpublishChangedExpansion(Expansion exp)
    
public  voidpublishRemovalOfAllocation(Allocation alloc)
    
protected  voidreplanDependingTasks(Task parentTask, long beforeTime)
     re-examine the workflow to see if the any tasks overlap the time of the recently changed allocation, if they do, replan tasks that depend on it.
public  voidreportChangedExpansion(Expansion exp)
     Mainly just calls updateAllocationResult on exp Also prints debug info when tasks fail.
public  voidsetupFilters()
    
public  voidturnCrank(Task task)
     turnCrank is a basic planning cycle.
public  booleanwantToChangeExpansion(Expansion exp)
    

Field Detail
childToParentUID
Map childToParentUID(Code)



delayedTasks
protected List delayedTasks(Code)



myAllocCallback
protected UTILAllocationCallback myAllocCallback(Code)



myAssetCallback
protected UTILAssetCallback myAssetCallback(Code)



myExpansionCallback
protected UTILExpansionCallback myExpansionCallback(Code)



myInputTaskCallback
protected UTILExpandableTaskCallback myInputTaskCallback(Code)



taskToSSE
Map taskToSSE(Code)



tryToReplanOverlaps
boolean tryToReplanOverlaps(Code)



waitTime
protected long waitTime(Code)





Method Detail
allNecessaryAssetsReported
protected boolean allNecessaryAssetsReported()(Code)



attachSubtask
protected void attachSubtask(Task subtask, SequentialScheduleElement spe)(Code)
attachSubtask adds a created subtask to the parent task's expansion. remembers subtask->schedule element mapping in a map. sets the task pointer on the schedule element



changeExpansion
public void changeExpansion(Expansion exp)(Code)



createAllocCallback
protected UTILAllocationCallback createAllocCallback()(Code)



createAssetCallback
protected UTILAssetCallback createAssetCallback()(Code)



createEmptyPlan
abstract public Schedule createEmptyPlan(Task parent)(Code)
createEmptyPlan creates an empty schedule (there are no tasks yet in the workflow) made up of custom schedule elements. These schedule elements define a planMe method that adds a subtask to the parent task's workflow. Generally for each schedule element in the schedule returned here, there will be a subtask added to the workflow.
See Also:   org.cougaar.logistics.plugin.trans.base.SequentialScheduleElement.planMe
Parameters:
  parent - referenced by sequential schedule elements in the returned schedule Schedule of sequential schedule elements that represent the steps of the backwards planning



createExpansionCallback
protected UTILExpansionCallback createExpansionCallback()(Code)



createThreadCallback
protected UTILFilterCallback createThreadCallback(UTILGenericListener bufferingThread)(Code)



enterHash
public void enterHash(String key, SequentialScheduleElement obj)(Code)
connect SSE to task so that you can do SSE processing when task returns **



execute
protected void execute()(Code)



getAllocCallback
protected UTILAllocationCallback getAllocCallback()(Code)



getAssetCallback
protected UTILAssetCallback getAssetCallback()(Code)



getAssets
final protected Iterator getAssets()(Code)



getChildToParentUID
public Map getChildToParentUID()(Code)



getElement
protected SequentialScheduleElement getElement(Task child, Task parent, String uid)(Code)
Finds the schedule element for the child task in the taskToSSE map. If the map is empty (after rehydration) we look up the schedule element in the parent task's schedule. If we were to attach the schedule element to the child task (which would be the easier approach) we would drag the dependencies and all the tasks hanging off them into the downstream agent, which sucks from a memory point-of-view. Deals with post-rehydration state by looking at parent task.
Parameters:
  child - task to look for matching SequentialScheduleElement
Parameters:
  parent - of child task (where we look for the schedule elements)
Parameters:
  uid - of child task SequentialScheduleElement that has the planning info for child



getExpansionCallback
protected UTILExpansionCallback getExpansionCallback()(Code)



getInputTaskCallback
protected UTILFilterCallback getInputTaskCallback()(Code)



getParentTask
public Task getParentTask(Task child, String uid)(Code)
Gets the parent task for the child task with the UID uid. Uses a map to look up parents of child - if no key in the map, does a blackboard query (CPU expensive!). deals with post-rehydration state



getPrunedTaskList
protected List getPrunedTaskList(List tasks)(Code)
probably unnecessary



handleChangedAssets
public void handleChangedAssets(Enumeration e)(Code)



handleConstraintViolation
public void handleConstraintViolation(Expansion exp, List violatedConstraints)(Code)



handleFailedExpansion
public void handleFailedExpansion(Expansion exp, List failedSubTaskResults)(Code)



handleIllFormedTask
public void handleIllFormedTask(Task t)(Code)



handleNewAssets
public void handleNewAssets(Enumeration e)(Code)



handleRemovedAlloc
public void handleRemovedAlloc(Allocation alloc)(Code)



handleRescindedAlloc
public boolean handleRescindedAlloc(Allocation alloc)(Code)



handleSuccessfulAlloc
public void handleSuccessfulAlloc(Allocation alloc)(Code)
When an allocation is succesful you ignore it unless it is a meaningful allocation. Meaningful is defined as having a non-null reported result and a highest confidence rating. This would indicate that an allocation to an actual resource has been done. If there is a successful allocation the schedule element corresponding to the task will be grabbed and finishPlan will be run on it. Then another planning cycle will begin.
Parameters:
  alloc - that has been changed (i.e. a downstream agent has sent back an allocation result)



handleSuccessfulExpansion
public void handleSuccessfulExpansion(Expansion exp, List successfulSubtasks)(Code)



handleTask
public void handleTask(Task t)(Code)
handleTask creates an empty schedule and attaches it to the parent task. It also creates an expansion which starts empty and initiates a "planning cycle".



interestingAsset
public boolean interestingAsset(Asset a)(Code)



interestingExpandedTask
public boolean interestingExpandedTask(Task t)(Code)



interestingNotification
public boolean interestingNotification(Task t)(Code)



interestingTask
public boolean interestingTask(Task t)(Code)



localSetup
public void localSetup()(Code)



needToRescind
public boolean needToRescind(Allocation alloc)(Code)



processTasks
public void processTasks(List tasks)(Code)
If necessary subordinates have not reported yet, accumulates tasks into a delayedTasks list, and asks to be kicked again in 10 seconds, by which time hopefully the subordinates have reported. Solves the race condition between tasks showing up and subordinates showing up.
Parameters:
  tasks - to process



publicGetFactory
public PlanningFactory publicGetFactory()(Code)
Set of dumb functions to get around incredibly annoying Java Compiler bugs **



publicGetMessageAddress
public MessageAddress publicGetMessageAddress()(Code)



publicGetMyClusterName
public String publicGetMyClusterName()(Code)



publicGetRealityPlan
public Plan publicGetRealityPlan()(Code)



publicPublishAdd
public void publicPublishAdd(Object o)(Code)



publicPublishChange
public void publicPublishChange(Object o)(Code)



publishChangedExpansion
public void publishChangedExpansion(Expansion exp)(Code)



publishRemovalOfAllocation
public void publishRemovalOfAllocation(Allocation alloc)(Code)



replanDependingTasks
protected void replanDependingTasks(Task parentTask, long beforeTime)(Code)
re-examine the workflow to see if the any tasks overlap the time of the recently changed allocation, if they do, replan tasks that depend on it.



reportChangedExpansion
public void reportChangedExpansion(Expansion exp)(Code)
Mainly just calls updateAllocationResult on exp Also prints debug info when tasks fail.



setupFilters
public void setupFilters()(Code)



turnCrank
public void turnCrank(Task task)(Code)
turnCrank is a basic planning cycle. It looks through all the elements in the empty schedule and if one is ready to be planned it plans it. It also places the parenttask in a hashtable so it can be easily retrieved later when the subtask is succesfully allocated. Operates on the parent task of a backwards-planning expansion, e.g. the parent task of a typical Conus->Air/Sea->Theater triplet workflow.
Parameters:
  task - parent task of expansion



wantToChangeExpansion
public boolean wantToChangeExpansion(Expansion exp)(Code)



Fields inherited from org.cougaar.lib.filter.UTILBufferingPluginAdapter
protected AgentIdentificationService agentIDService(Code)(Java Doc)
protected UTILBufferingThread bufferingThread(Code)(Java Doc)
protected PluginAlarm currentAlarm(Code)(Java Doc)
protected UTILPreference prefHelper(Code)(Java Doc)
protected QuiescenceReportService qService(Code)(Java Doc)
protected Schedulable schedulable(Code)(Java Doc)
protected ThreadService threadService(Code)(Java Doc)
protected UTILVerify verify(Code)(Java Doc)

Methods inherited from org.cougaar.lib.filter.UTILBufferingPluginAdapter
protected UTILBufferingThread createBufferingThread()(Code)(Java Doc)
abstract protected UTILFilterCallback createThreadCallback(UTILGenericListener listener)(Code)(Java Doc)
public void examineBufferAgainIn(long delayTime)(Code)(Java Doc)
protected void execute()(Code)(Java Doc)
protected UTILBufferingThread getBufferingThread()(Code)(Java Doc)
public boolean interestingTask(Task t)(Code)(Java Doc)
public boolean isTaskWellFormed(Task t)(Code)(Java Doc)
public void localSetup()(Code)(Java Doc)
abstract public void processTasks(List tasks)(Code)(Java Doc)
protected void reportIllFormedTask(Task t)(Code)(Java Doc)
public void resume()(Code)(Java Doc)
final public void setQuiescenceReportService(QuiescenceReportService qService)(Code)(Java Doc)
public void setupFilters()(Code)(Java Doc)
public void wakeUp()(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.