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


org.cougaar.planning.plugin.legacy.SimplePlugin
   org.cougaar.mlm.plugin.sample.StrategicTransportProjectorPlugin

StrategicTransportProjectorPlugin
public class StrategicTransportProjectorPlugin extends SimplePlugin (Code)
Class StrategicTransportProjectorPlugin is a replacement for StrategicTranportProjectionExpanderPlugin.

This class subscribes to the single "Deploy" "DetermineRequirements" Task and expands it to "Transport" Tasks for all applicable assets.

Currently expects only one oplan, one "self" org activity, and one "Deploy" "DetermineRequirements" task.

Debug information is now off by default. See method setDebug()


Inner Class :protected static class OplanByUIDPred implements UnaryPredicate
Inner Class :protected static class DeployPlan

Field Summary
final public static  longMILLIS_PER_DAY
    
protected  booleancreateAssetGroups
    
protected  intdefaultAdjustDurationDays
     Defaults optionally set by parameters.
protected  IncrementalSubscriptiondrTasksSub
    
protected  IncrementalSubscriptionexpansionsSub
    
protected  IncrementalSubscriptionfailedDRAllocsSub
    
 LocationParserlocationParser
    
protected  LoggingServicelogger
    
protected  intoffsetDays
    
protected  IncrementalSubscriptionorgDeployActsSub
    
protected  StringoriginFile
    
protected  GeolocLocationoverrideFromLocation
    
protected  OrganizationselfOrg
    
protected  StringselfOrgId
    
protected  IncrementalSubscriptionselfOrgsSub
    
protected  DeployPlansingleDeployPlan
     Holder for info required to handle the determine requirements task.
protected static  AbstractAssetstrans
    
protected  IncrementalSubscriptiontransAssetsEquipmentSub
    
protected  IncrementalSubscriptiontransAssetsPersonSub
    


Method Summary
protected  voidexecute()
     Execute.
protected  voidexpandDetermineRequirements(DeployPlan dp, Task drTask, Enumeration assetsEnum)
     Expand a DetermineRequirements Task.

All the expanded tasks are very similar.

protected  OrgActivityfindSelfOrgDeployAct(Enumeration eOrgActs)
    
protected  DeployPlangetDeployPlan()
    
protected  TaskgetDetermineRequirementsTask()
    
public  GeolocLocationgetGeoLoc(String xmlfilename)
    
protected static  StringgetOrgID(Organization org)
    
protected  voidkillWorkflow(Workflow wf)
    
protected  NewTaskmakeTransportTask(Task drTask, Asset assetForTransport, Vector prepphrases, Vector prefs, NewWorkflow wf)
    
protected static  UnaryPredicatenewDRTasksPred()
     The predicate for our incoming tasks.
protected static  UnaryPredicatenewExpansionsPred()
     Test if this object is an expansion of one of our tasks.
protected static  UnaryPredicatenewFailedDRAllocPred()
     Pred for failed allocations of a expanded DetermineRequirements tasks we published.
protected static  UnaryPredicatenewOrgDeployActsPred()
     OrgActivity of type "Deployment" predicate.
protected static  UnaryPredicatenewSelfOrgPred()
     Self Organization predicate.
protected static  DynamicUnaryPredicatenewTransEquipmentPred()
     See bug 2998 in bugzilla. In order to not strat trans move Level2MEIs we filter out equipment with the cargo cat code of "000" which means phantom equipment.
protected static  UnaryPredicatenewTransPersonPred()
    
final protected  voidprintDebug(String s)
    
final protected  voidprintError(String s)
    
final protected  voidprintInfo(String s)
    
final protected  voidprintWarn(String s)
    
protected  VectorremoveZeroQuantityAggregates(Enumeration assets)
    
protected  voidreplaceDeployPlan(OrgActivity selfOrgAct)
    
protected  voidsetDefaults(Enumeration eParams)
    
protected  voidsetDeployPlan(DeployPlan dp)
    
final public  voidsetLoggingService(LoggingService logger)
     rely upon load-time introspection to set these services - don't worry about revokation.
protected  voidsetupSubscriptions()
     Subscribe.
protected  voidwatchAddedOrgDeployActs(Enumeration eOrgActs)
    
protected  voidwatchAddedSelfOrgDeployAct(OrgActivity selfOrgAct)
     Handle added OrgActs with type "Deployment".
protected  voidwatchAddedSelfOrgs(Enumeration eSelfOrgs)
     These methods related to having a single oplan, a single self organization, a single self OrgActivity, and a single "Deployment" "DetermineRequirements" Task.
protected  voidwatchAddedTransportableAssets(Enumeration eAssets)
     Take added transportable Assets and expand them to transport tasks.
protected  voidwatchChangedOrgDeployActs(Enumeration eOrgActs)
    
protected  voidwatchChangedSelfOrgDeployAct(OrgActivity selfOrgAct)
     Handle changed OrgActs.
protected  voidwatchChangedTransportableAssets(Enumeration eAssets)
     Handle changed transportable Assets.
protected  voidwatchFailedDispositions(Enumeration eFailedAllocs)
     Handle failed allocations to tasks that are subtasks to a DetermineRequirements task we expanded.
protected  voidwatchRemovedDetermineRequirementsTasks()
     Handle removed DetermineRequirements Task.
protected  voidwatchRemovedOrgDeployActs(Enumeration eOrgActs)
    
protected  voidwatchRemovedSelfOrgDeployAct(OrgActivity selfOrgAct)
     Handle removed selfOrgAct.
protected  voidwatchRemovedTransportableAssets(Enumeration eAssets)
     Handle removed transportable Assets by removing any expanded determine requirements subtasks that depend on them.

Field Detail
MILLIS_PER_DAY
final public static long MILLIS_PER_DAY(Code)



createAssetGroups
protected boolean createAssetGroups(Code)
Expand into an AssetGroup if true, else separate Tasks if false *



defaultAdjustDurationDays
protected int defaultAdjustDurationDays(Code)
Defaults optionally set by parameters. *



drTasksSub
protected IncrementalSubscription drTasksSub(Code)
Subscription to DetermineRequirement Tasks *



expansionsSub
protected IncrementalSubscription expansionsSub(Code)
Subscription to Expansions *



failedDRAllocsSub
protected IncrementalSubscription failedDRAllocsSub(Code)
Subscription to Failed Allocations *



locationParser
LocationParser locationParser(Code)



logger
protected LoggingService logger(Code)
Everybody needs a logger



offsetDays
protected int offsetDays(Code)
Number of days added to the Oplan C Day used for Task startDate *



orgDeployActsSub
protected IncrementalSubscription orgDeployActsSub(Code)
Subscription to orgActivities for Deployment *



originFile
protected String originFile(Code)
XML file containing description of GeolocLocation used for Task fromLocation *



overrideFromLocation
protected GeolocLocation overrideFromLocation(Code)
GeolocLocation specified in XML file used for Task fromLocation *



selfOrg
protected Organization selfOrg(Code)



selfOrgId
protected String selfOrgId(Code)



selfOrgsSub
protected IncrementalSubscription selfOrgsSub(Code)
Self Organization Info *



singleDeployPlan
protected DeployPlan singleDeployPlan(Code)
Holder for info required to handle the determine requirements task. *



strans
protected static AbstractAsset strans(Code)



transAssetsEquipmentSub
protected IncrementalSubscription transAssetsEquipmentSub(Code)
Subscription to Transportable Equipment Assets *



transAssetsPersonSub
protected IncrementalSubscription transAssetsPersonSub(Code)
Subscription to Transportable Person Assets *





Method Detail
execute
protected void execute()(Code)
Execute.



expandDetermineRequirements
protected void expandDetermineRequirements(DeployPlan dp, Task drTask, Enumeration assetsEnum)(Code)
Expand a DetermineRequirements Task.

All the expanded tasks are very similar. Each task instance is separately allocated, but the contents are shared (shallow copy)

Here we find the first and second assets from the assetEnum, optionally creating an AssetGroup, then we expand to tasks.


Parameters:
  drTask - DetermineRequirements Task to expand
Parameters:
  assetsEnum - Enumeration of assets for transport




findSelfOrgDeployAct
protected OrgActivity findSelfOrgDeployAct(Enumeration eOrgActs)(Code)



getDeployPlan
protected DeployPlan getDeployPlan()(Code)
Only one plan with one "Deployment" DetermineRequirements Task expected!



getDetermineRequirementsTask
protected Task getDetermineRequirementsTask()(Code)



getGeoLoc
public GeolocLocation getGeoLoc(String xmlfilename)(Code)



getOrgID
protected static String getOrgID(Organization org)(Code)



killWorkflow
protected void killWorkflow(Workflow wf)(Code)
NOBODY CALLS THIS! Little utility to remove a workflow and expansion



makeTransportTask
protected NewTask makeTransportTask(Task drTask, Asset assetForTransport, Vector prepphrases, Vector prefs, NewWorkflow wf)(Code)



newDRTasksPred
protected static UnaryPredicate newDRTasksPred()(Code)
The predicate for our incoming tasks. We are looking for DETERMINEREQUIREMENT tasks of type Asset where the asset type is StrategicTransportation.



newExpansionsPred
protected static UnaryPredicate newExpansionsPred()(Code)
Test if this object is an expansion of one of our tasks. We use taskPred for the latter.



newFailedDRAllocPred
protected static UnaryPredicate newFailedDRAllocPred()(Code)
Pred for failed allocations of a expanded DetermineRequirements tasks we published. We use newDRTasksPred for testing the task.



newOrgDeployActsPred
protected static UnaryPredicate newOrgDeployActsPred()(Code)
OrgActivity of type "Deployment" predicate.



newSelfOrgPred
protected static UnaryPredicate newSelfOrgPred()(Code)
Self Organization predicate.



newTransEquipmentPred
protected static DynamicUnaryPredicate newTransEquipmentPred()(Code)
See bug 2998 in bugzilla. In order to not strat trans move Level2MEIs we filter out equipment with the cargo cat code of "000" which means phantom equipment. The phantom equipment corresponds to Level2MEIs. The cargo cat code is put onto the Level2MEIs retroactively after they have been made that is the reason for the DynamicUnaryPredicate.



newTransPersonPred
protected static UnaryPredicate newTransPersonPred()(Code)



printDebug
final protected void printDebug(String s)(Code)
Debug printer



printError
final protected void printError(String s)(Code)



printInfo
final protected void printInfo(String s)(Code)
Info printer



printWarn
final protected void printWarn(String s)(Code)
Warn printer



removeZeroQuantityAggregates
protected Vector removeZeroQuantityAggregates(Enumeration assets)(Code)
Filter out invalid zero quantity aggregates from those to make transport tasks for
Parameters:
  assets - original list of assets published to blackboard Vector of valid assets



replaceDeployPlan
protected void replaceDeployPlan(OrgActivity selfOrgAct)(Code)



setDefaults
protected void setDefaults(Enumeration eParams)(Code)



setDeployPlan
protected void setDeployPlan(DeployPlan dp)(Code)



setLoggingService
final public void setLoggingService(LoggingService logger)(Code)
rely upon load-time introspection to set these services - don't worry about revokation.



setupSubscriptions
protected void setupSubscriptions()(Code)
Subscribe.



watchAddedOrgDeployActs
protected void watchAddedOrgDeployActs(Enumeration eOrgActs)(Code)



watchAddedSelfOrgDeployAct
protected void watchAddedSelfOrgDeployAct(OrgActivity selfOrgAct)(Code)
Handle added OrgActs with type "Deployment". We want this OrgActivity-based DeployPlan saved. Assume only one such OrgActivity



watchAddedSelfOrgs
protected void watchAddedSelfOrgs(Enumeration eSelfOrgs)(Code)
These methods related to having a single oplan, a single self organization, a single self OrgActivity, and a single "Deployment" "DetermineRequirements" Task.



watchAddedTransportableAssets
protected void watchAddedTransportableAssets(Enumeration eAssets)(Code)
Take added transportable Assets and expand them to transport tasks.


Parameters:
  eAssets - Enumeration of added assets




watchChangedOrgDeployActs
protected void watchChangedOrgDeployActs(Enumeration eOrgActs)(Code)



watchChangedSelfOrgDeployAct
protected void watchChangedSelfOrgDeployAct(OrgActivity selfOrgAct)(Code)
Handle changed OrgActs. We may need to change the associated DeployPlan and/or tweek the expansion.

For now we do something harsh:

  1. clear the existing orgAct deploy plan
  2. re-add the orgAct for a new deploy plan
  3. if there was a DRTask, re-add it over the old one.



watchChangedTransportableAssets
protected void watchChangedTransportableAssets(Enumeration eAssets)(Code)
Handle changed transportable Assets.

Do this the hard way:

  1. remove all subtasks created to transport the assets
  2. make new subtasks to transport them


Parameters:
  eAssets - Enumeration of added assets




watchFailedDispositions
protected void watchFailedDispositions(Enumeration eFailedAllocs)(Code)
Handle failed allocations to tasks that are subtasks to a DetermineRequirements task we expanded.

If a subtask failed then we'll simply slide back start/end times by the determineRequirement's DeployPlan adjustDurationDays.

Do we want to fix earliestDate against current time?


Parameters:
  eFailedAllocs - Enumeration of failed allocations




watchRemovedDetermineRequirementsTasks
protected void watchRemovedDetermineRequirementsTasks()(Code)
Handle removed DetermineRequirements Task.

Removed task should remove it's subtasks, so we only need to clean out it's DeployPlan.




watchRemovedOrgDeployActs
protected void watchRemovedOrgDeployActs(Enumeration eOrgActs)(Code)



watchRemovedSelfOrgDeployAct
protected void watchRemovedSelfOrgDeployAct(OrgActivity selfOrgAct)(Code)
Handle removed selfOrgAct. Remove the expansion of the d.r. task if it still exists.



watchRemovedTransportableAssets
protected void watchRemovedTransportableAssets(Enumeration eAssets)(Code)
Handle removed transportable Assets by removing any expanded determine requirements subtasks that depend on them.


Parameters:
  eAssets - Enumeration of assets that were removed




Methods inherited from org.cougaar.planning.plugin.legacy.SimplePlugin
public AllocationResult createEstimatedAllocationResult(Task t, double confidenceRating, boolean success)(Code)(Java Doc)
public void createPublishExpansion(Task parent)(Code)(Java Doc)
final protected void cycle()(Code)(Java Doc)
abstract protected void execute()(Code)(Java Doc)
final public void initialize() throws StateModelException(Code)(Java Doc)
public void load(Object object) throws StateModelException(Code)(Java Doc)
final protected void prerun()(Code)(Java Doc)
final public void resume() throws StateModelException(Code)(Java Doc)
protected void setExecutionDelay(long minDelay, long maxDelay)(Code)(Java Doc)
abstract protected void setupSubscriptions()(Code)(Java Doc)
final public void start() throws StateModelException(Code)(Java Doc)
final public void stop() throws StateModelException(Code)(Java Doc)
final public void suspend() throws StateModelException(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.