| java.lang.Object org.cougaar.glm.plugins.multiplesuppliers.Utility
Utility | final public class Utility (Code) | | This Utility class consists of "public final static" methods that perform various useful Cougaar tasks.
In particular, this class contains methods for cloning tasks, creating subtasks, allocation results and failed allocations.
There are also methods that return specific Organization assets with desired capabilities, roles or even by name.
|
Method Summary | |
final public static NewTask | cloneTask(PlanningFactory factory, Task task) Create a new Task object using the grammatical elements of the input task.
For prepositional phrases with indirect objects that are instances of Vector,
a new Vector is created for the clone. | final public static NewTask | cloneTask(PlanningFactory factory, Task task, String[] prepositionsToExclude) Create a new Task object using the grammatical elements of the input task.
For prepositional phrases with indirect objects that are instances of Vector,
a new Vector is created for the clone. | final public static Allocation | createAllocation(PlanningFactory factory, Task task, Asset asset, double cost, double quantity) Create an Allocation object (incorporating COST, QUANTITY and SCHEDULE). | final public static Allocation | createAllocation(PlanningFactory factory, Task task, Asset asset, double cost, double quantity, Role roleOfAsset) Create an Allocation object (incorporating COST, QUANTITY, SCHEDULE, and associated Role).
Parameters: factory - reference to cluster's PlanningFactory Parameters: task - the task being disposed of by this Allocation. Parameters: asset - used to perform the task Parameters: cost - the value to set the COST aspect value to Parameters: quantity - the value to set the QUANTITY aspect value to Parameters: roleOfAsset - the role of the asset performing this task. | final public static AllocationResult | createAllocationResult(PlanningFactory factory, boolean successFlag, double startTime, double endTime, double cost, double quantity) Create an AllocationResult object (incorporating START_TIME, END_TIME, COST and QUANTITY). | final public static NewTask | createSubtaskFromTask(PlanningFactory factory, Task task) Create a new subtask using the grammatical elements of the input task,
further establishing the input task as the parent of the new subtask.
Parameters: factory - reference to cluster's PlanningFactory Parameters: task - the task whose grammatical elements will be usedto create a new Task object. | final public static NewTask | createSubtaskFromTask(PlanningFactory factory, Task task, String[] prepositionsToExclude) Create a new subtask using the grammatical elements of the input task,
further establishing the input task as the parent of the new subtask.
Parameters: factory - reference to cluster's PlanningFactory Parameters: task - the task whose grammatical elements will be usedto create a new Task object. Parameters: prepositionsToExclude - a list of prepositional phrases that should not be copied fromthe original task to the new task. | final public static boolean | equalResults(AllocationResult ar1, AllocationResult ar2) Determine if two AllocationResult objects are equal by comparing
START_TIME, END_TIME, COST and QUNATITY.
Parameters: ar1 - 1st AllocationResult in comparison. Parameters: ar2 - 2nd AllocationResult in comparison. | final public static Organization | findNamedOrganization(String organizationName, Enumeration organizationAssets) Return Organization with the given name.
Parameters: organizationName - the name of the desired organization. Parameters: organizationAssets - list of Organizations to choose from. | final public static Enumeration | findOrgsWithCapability(String testCapableRole, Enumeration organizationAssets) Obtain a list or Organizations with a particular Role.
Parameters: testCapableRole - the Role to find matching Organizations for. Parameters: organizationAssets - list of Organizations to choose from. | final public static Enumeration | getAdministrativeSubordinates(Organization org) Obtain list of Administrative Subordinates for an organization. | final public static Enumeration | getAdministrativeSuperiors(Organization org) Obtain list of Administrative Superiors for an organization. | final public static Task | getLastSubtaskInWorkflow(Workflow workflow) Obtain reference to last subtask in a workflow. | final public static Collection | getOrganizationRoles(Organization organization) Return Collection of Organization's roles.
Parameters: organization - the Organization to find Roles for. | final public static Task | getTaskWithUID(Enumeration tasks, String uid) Return Task with the given UID.
Parameters: tasks - list of Tasks to choose from. Parameters: uid - the UID of the desired Task. | final public static Disposition | makeFailedDisposition(PlanningFactory factory, Task task) Create an Failed Disposition object associated with a task.
Parameters: factory - reference to cluster's PlanningFactory Parameters: task - the task to be associated with the Disposition. | final public static boolean | testCapableRole(Organization organization, String testrole) Does the input Organization have the desired Role?
Parameters: organization - the Organization to test for desired Role. Parameters: testrole - the desired Role to test for. |
cloneTask | final public static NewTask cloneTask(PlanningFactory factory, Task task)(Code) | | Create a new Task object using the grammatical elements of the input task.
For prepositional phrases with indirect objects that are instances of Vector,
a new Vector is created for the clone. The contents of the original Vector are
copied by reference to the new Vector. This way, the new Vector's content can
be changed without effecting the original Vector.
Parameters: factory - reference to cluster's PlanningFactory Parameters: task - the task whose grammatical elements will be usedto create a new Task object. A newly created Task patterned from an input task. |
cloneTask | final public static NewTask cloneTask(PlanningFactory factory, Task task, String[] prepositionsToExclude)(Code) | | Create a new Task object using the grammatical elements of the input task.
For prepositional phrases with indirect objects that are instances of Vector,
a new Vector is created for the clone. The contents of the original Vector are
copied by reference to the new Vector. This way, the new Vector's content can
be changed without effecting the original Vector.
Parameters: factory - reference to cluster's PlanningFactory Parameters: task - the task whose grammatical elements will be usedto create a new Task object. Parameters: prepositionsToExclude - a list of prepositional phrases that should not be copied fromthe original task to the new task. A newly created Task patterned from an input task. |
createAllocation | final public static Allocation createAllocation(PlanningFactory factory, Task task, Asset asset, double cost, double quantity)(Code) | | Create an Allocation object (incorporating COST, QUANTITY and SCHEDULE).
Parameters: factory - reference to cluster's PlanningFactory Parameters: task - the task being disposed of by this Allocation. Parameters: asset - used to perform the task Parameters: cost - the value to set the COST aspect value to Parameters: quantity - the value to set the QUANTITY aspect value to an Allocation object which is the disposition of the input task |
createAllocation | final public static Allocation createAllocation(PlanningFactory factory, Task task, Asset asset, double cost, double quantity, Role roleOfAsset)(Code) | | Create an Allocation object (incorporating COST, QUANTITY, SCHEDULE, and associated Role).
Parameters: factory - reference to cluster's PlanningFactory Parameters: task - the task being disposed of by this Allocation. Parameters: asset - used to perform the task Parameters: cost - the value to set the COST aspect value to Parameters: quantity - the value to set the QUANTITY aspect value to Parameters: roleOfAsset - the role of the asset performing this task. If roleOfAsset is null,Role.BOGUS will be used. an Allocation object which is the disposition of the input task |
createAllocationResult | final public static AllocationResult createAllocationResult(PlanningFactory factory, boolean successFlag, double startTime, double endTime, double cost, double quantity)(Code) | | Create an AllocationResult object (incorporating START_TIME, END_TIME, COST and QUANTITY).
This method sets confidence rating to 1.0.
Parameters: factory - reference to cluster's PlanningFactory Parameters: successFlag - success value to associate with this allocation result. Parameters: startTime - of this allocation Parameters: endTime - of this allocation Parameters: cost - the value to set the COST aspect value to Parameters: quantity - the value to set the QUANTITY aspect value to an AllocationResult object with aspect set to input values |
createSubtaskFromTask | final public static NewTask createSubtaskFromTask(PlanningFactory factory, Task task)(Code) | | Create a new subtask using the grammatical elements of the input task,
further establishing the input task as the parent of the new subtask.
Parameters: factory - reference to cluster's PlanningFactory Parameters: task - the task whose grammatical elements will be usedto create a new Task object. A newly created Task patterned from an input task. |
createSubtaskFromTask | final public static NewTask createSubtaskFromTask(PlanningFactory factory, Task task, String[] prepositionsToExclude)(Code) | | Create a new subtask using the grammatical elements of the input task,
further establishing the input task as the parent of the new subtask.
Parameters: factory - reference to cluster's PlanningFactory Parameters: task - the task whose grammatical elements will be usedto create a new Task object. Parameters: prepositionsToExclude - a list of prepositional phrases that should not be copied fromthe original task to the new task. A newly created Task patterned from an input task. |
equalResults | final public static boolean equalResults(AllocationResult ar1, AllocationResult ar2)(Code) | | Determine if two AllocationResult objects are equal by comparing
START_TIME, END_TIME, COST and QUNATITY.
Parameters: ar1 - 1st AllocationResult in comparison. Parameters: ar2 - 2nd AllocationResult in comparison. true/false are the AllocationResults equals? |
findNamedOrganization | final public static Organization findNamedOrganization(String organizationName, Enumeration organizationAssets)(Code) | | Return Organization with the given name.
Parameters: organizationName - the name of the desired organization. Parameters: organizationAssets - list of Organizations to choose from. Organization with given name. |
findOrgsWithCapability | final public static Enumeration findOrgsWithCapability(String testCapableRole, Enumeration organizationAssets)(Code) | | Obtain a list or Organizations with a particular Role.
Parameters: testCapableRole - the Role to find matching Organizations for. Parameters: organizationAssets - list of Organizations to choose from. list or Organizations with a desired Role. |
getAdministrativeSubordinates | final public static Enumeration getAdministrativeSubordinates(Organization org)(Code) | | Obtain list of Administrative Subordinates for an organization.
Parameters: org - whose Administrative Subordinates to find the list of Administrative Subordinates |
getAdministrativeSuperiors | final public static Enumeration getAdministrativeSuperiors(Organization org)(Code) | | Obtain list of Administrative Superiors for an organization.
Parameters: org - whose Administrative Superiors to find the list of Administrative Superiors |
getLastSubtaskInWorkflow | final public static Task getLastSubtaskInWorkflow(Workflow workflow)(Code) | | Obtain reference to last subtask in a workflow. Useful if you need to add a new task to a workflow
with aspects of the new task based on that last task or its allocation results.
Parameters: workflow - to find last subtask of. the last task in the workflow |
getOrganizationRoles | final public static Collection getOrganizationRoles(Organization organization)(Code) | | Return Collection of Organization's roles.
Parameters: organization - the Organization to find Roles for. list of Roles associated with input Organization. |
getTaskWithUID | final public static Task getTaskWithUID(Enumeration tasks, String uid)(Code) | | Return Task with the given UID.
Parameters: tasks - list of Tasks to choose from. Parameters: uid - the UID of the desired Task. Task with given UID. |
makeFailedDisposition | final public static Disposition makeFailedDisposition(PlanningFactory factory, Task task)(Code) | | Create an Failed Disposition object associated with a task.
Parameters: factory - reference to cluster's PlanningFactory Parameters: task - the task to be associated with the Disposition. a Failed Disposition object associated with the task |
testCapableRole | final public static boolean testCapableRole(Organization organization, String testrole)(Code) | | Does the input Organization have the desired Role?
Parameters: organization - the Organization to test for desired Role. Parameters: testrole - the desired Role to test for. true/false - Does the input Organization have the desired Role? |
|
|