| org.cougaar.lib.filter.UTILExpanderPluginAdapter org.cougaar.logistics.plugin.strattrans.StrategicTransportProjectorPlugin
StrategicTransportProjectorPlugin | public class StrategicTransportProjectorPlugin extends UTILExpanderPluginAdapter implements UTILOrgActivityListener,UTILOrganizationListener,UTILParameterizedAssetListener(Code) | | Class org.cougaar.logistics.plugin.strattrans.StrategicTransportProjectorPlugin is a replacement
for org.cougaar.mlm.plugin.sample.StrategicTranportProjectorPlugin .
(updated based upon ComponentPlugin and Toolkit)
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 :class SubscriptionResults | |
Method Summary | |
public SubscriptionResults | checkSubscriptions() Returns a structure containing all the information extracted from the blackboard. | protected UTILOrgActivityCallback | createOrgActivityCallback() | protected UTILOrganizationCallback | createOrganizationCallback() | protected UTILParameterizedAggregateAssetCallback | createParameterizedAggregateAssetCallback(String key, boolean isDynamic) | protected UTILFilterCallback | createThreadCallback(UTILGenericListener bufferingThread) Provide the callback that is paired with the buffering thread, which is a
listener. | protected Vector | getMEIAssets() | protected OrgActivity | getOrgActivity(String id) | protected String | getOrgID(Organization org) | protected Vector | getPersonAssets() | protected Organization | getSelfOrg() | public Vector | getSubtasks(Task task) Expands the task using information from several different subscriptions
If the key subscriptions have not been filled, as determined by checkSubscriptions(),
then returns an empty Vector, which must be handled appropriately by higher levels. | public Vector | getSubtasks(Task task, SubscriptionResults subscriptionResults) Overloaded for efficient checking of subscriptions.
Returns empty vector if the task is in the past. | public void | handleChangedOrgActivities(Enumeration e) | public void | handleChangedOrganizations(Enumeration e) Does NOT replan on changed org.
If we replan on changed org - will always replan on rehydrate,
when the org changes when the agent is reconstituted.
Why the org changes, I'm not sure. | public void | handleChangedParameterizedAssets(Enumeration e, String key) | public void | handleNewOrgActivities(Enumeration e) | public void | handleNewOrganizations(Enumeration e) | public void | handleNewParameterizedAssets(Enumeration e, String key) | public void | handleTask(Task t)
Implemented for UTILGenericListener interface
This method Expands the given Task and publishes the PlanElement,
but only if subtasks have been created. | public void | handleTask(Task t, SubscriptionResults subscriptionResults) | public boolean | interestingOrgActivity(OrgActivity orgAct) | public boolean | interestingOrganization(Organization org) | public boolean | interestingParameterizedAsset(Asset o, String key) Interested in listening to Person/ClassVIIMajorEndItem assets
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. | public boolean | interestingTask(Task task) State that we are interested in all DETERMINEREQUIREMENT tasks of type Asset
where the asset type is StrategicTransportation.
Parameters: task - the task to test. | public boolean | orgActivityInThePast(SubscriptionResults subscriptionResults) Is the org activity for something in the past?
SubscriptionResults refers to org activity, which has a time span for when it's active. | public void | redoTasks() Replan tasks when one of the inputs has changed, typically the Org Activity. | public void | setupFilters() |
checkSubscriptions | public SubscriptionResults checkSubscriptions()(Code) | | Returns a structure containing all the information extracted from the blackboard.
Returns null if any key information is missing.
|
createThreadCallback | protected UTILFilterCallback createThreadCallback(UTILGenericListener bufferingThread)(Code) | | Provide the callback that is paired with the buffering thread, which is a
listener. The buffering thread is the listener to the callback
overridden to use UTILExpandableChildTaskCallback to allow
tasks that are child of another task (specifically required for
Strat-Trans Deter-Req tasks, which are child of GLS)
an UTILExpandableChildTaskCallback with the buffering thread as its listener See Also: org.cougaar.lib.callback.UTILWorkflowCallback |
getMEIAssets | protected Vector getMEIAssets()(Code) | | return Vector of ClassVIIMajorEndItem assets from (in myMEIAssetCallback bucket)
|
getOrgActivity | protected OrgActivity getOrgActivity(String id)(Code) | | return orgActivity with matching id (in myDeploymentOrgActivityCallback bucket)
|
getPersonAssets | protected Vector getPersonAssets()(Code) | | return Vector of Person assets from (in myPersonAssetCallback bucket)
|
getSelfOrg | protected Organization getSelfOrg()(Code) | | return "self" organization in mySelfOrganizationCallback bucket
|
getSubtasks | public Vector getSubtasks(Task task)(Code) | | Expands the task using information from several different subscriptions
If the key subscriptions have not been filled, as determined by checkSubscriptions(),
then returns an empty Vector, which must be handled appropriately by higher levels.
Parameters: task - the task to expand a vector with the expanded subtask |
getSubtasks | public Vector getSubtasks(Task task, SubscriptionResults subscriptionResults)(Code) | | Overloaded for efficient checking of subscriptions.
Returns empty vector if the task is in the past.
(note: still processes task if the deploy time span is null. May need to change this?)
empty vector if org activity is in the past, or if both person and MEI assets are missing |
handleChangedOrgActivities | public void handleChangedOrgActivities(Enumeration e)(Code) | | |
handleChangedOrganizations | public void handleChangedOrganizations(Enumeration e)(Code) | | Does NOT replan on changed org.
If we replan on changed org - will always replan on rehydrate,
when the org changes when the agent is reconstituted.
Why the org changes, I'm not sure. I just know it does on rehydrate.
|
handleTask | public void handleTask(Task t)(Code) | |
Implemented for UTILGenericListener interface
This method Expands the given Task and publishes the PlanElement,
but only if subtasks have been created.
The method expandTask should be implemented by child classes.
Parameters: t - the task to be expanded. |
handleTask | public void handleTask(Task t, SubscriptionResults subscriptionResults)(Code) | | overloaded for efficient checking of subscriptions
|
interestingOrgActivity | public boolean interestingOrgActivity(OrgActivity orgAct)(Code) | | Interested in listening to deployment org-activities (from interface
UTILOrgActivityListener, and linked to UTILOrgActivityCallback)
|
interestingOrganization | public boolean interestingOrganization(Organization org)(Code) | | Interested in listening to self-organization (from interface UTILOrganizationListener,
and linked to UTILOrganizationCallback)
|
interestingParameterizedAsset | public boolean interestingParameterizedAsset(Asset o, String key)(Code) | | Interested in listening to Person/ClassVIIMajorEndItem assets
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 (i.e., callback created with isDynamic true)
|
interestingTask | public boolean interestingTask(Task task)(Code) | | State that we are interested in all DETERMINEREQUIREMENT tasks of type Asset
where the asset type is StrategicTransportation.
Parameters: task - the task to test. true if the tasks verb is DetermineRequirements with the preposition "StrategicTransportation", false otherwise |
orgActivityInThePast | public boolean orgActivityInThePast(SubscriptionResults subscriptionResults)(Code) | | Is the org activity for something in the past?
SubscriptionResults refers to org activity, which has a time span for when it's active.
Compares with current cougaar time (not wall clock time).
|
redoTasks | public void redoTasks()(Code) | | Replan tasks when one of the inputs has changed, typically the Org Activity.
|
setupFilters | public void setupFilters()(Code) | | |
|
|