| java.lang.Object org.cougaar.planning.ldm.plan.AllocationResult
Constructor Summary | |
public | AllocationResult(double rating, boolean success, AspectValue[] aspectvalues) Constructor that takes a result in the form of AspectValues (NON-PHASED).
Subclasses of AspectValue, such as TypedQuantityAspectValue are allowed.
Parameters: rating - The confidence rating of this result. Parameters: success - Whether the allocationresult violated any preferences. Parameters: aspectvalues - The AspectValues(can be aspectvalue subclasses) that represent the results. | public | AllocationResult(double rating, boolean success, int[] keys, double[] values) | public | AllocationResult(double rating, boolean success, AspectValue[] rollupavs, Enumeration allresults) | public | AllocationResult(double rating, boolean success, int[] keys, double[] values, Enumeration allresults) | public | AllocationResult(double rating, boolean success, AspectValue[] rollupavs, Collection phasedresults) Constructor that takes a PHASED result in the form of AspectValues.
Subclasses of AspectValue, such as TypedQuantityAspectValue are allowed.
Parameters: rating - The confidence rating of this result. Parameters: success - Whether the allocationresult violated any preferences. Parameters: rollupavs - The Summary (or rolled up) AspectValues that represent the results. Parameters: phasedresults - A Collections of the phased results. | public | AllocationResult(AllocationResult ar1, AllocationResult ar2) Construct a merged AllocationResult containing AspectValues from
two AllocationResults. |
Method Summary | |
public void | addAuxiliaryQueryInfo(int aqtype, String data) Set a single AuxiliaryQueryType and its data (String). | public String | auxiliaryQuery(int aqtype) Return the String representing the auxilliary piece of data that
matches the query type given in the argument. | public Object | clone() | public static AspectValue[] | convertToAVA(int[] types, double[] values) | public AspectValue[] | difference(Preference[] prefs) | public String | getAspectTypeFromArray(int i) | public int[] | getAspectTypes() A Collection of AspectTypes representative of the type and
order of the aspects in each the result. | public String[] | getAspectTypesAsArray() | public AspectValue | getAspectValue(int aspectType) | public AspectValue[] | getAspectValueResults() A collection of AspectValues that represent the result for each
preference. | public double | getConfidenceRating() double The confidence rating of this result. | public List | getPhasedAspectValueResults() A List of Lists that represent each phased result in the form
of AspectValues.
If the result is not phased, use getAspectValueResults()
A List. | public Enumeration | getPhasedResults() A collection of arrays that represents each phased result.
If the result is not phased, use AllocationResult.getResult()
Warning!!! Not all AspectValues can be simply represented as
a double. | public double[][] | getPhasedResultsAsArray() Return phased results.
Warning!!! Not all AspectValues can be simply represented as
a double. | public double[] | getPhasedResultsFromArray(int i) Return a particular phase of a phased result as an array of doubles.
Warning!!! Not all AspectValues can be simply represented as
a double. | public double[] | getResult() A collection of doubles that represent the result for each
AspectType. | public String | getResultFromArray(int i) | public String[] | getResultsAsArray() | public double | getValue(int aspectType) Get the result with respect to a given AspectType. | public boolean | isDefined(int aspectType) Quick check to see if one aspect is defined as opposed to
looking through the AspectType array. | public boolean | isEqual(AllocationResult that) checks to see if the AllocationResult is equal to this one. | public boolean | isPhased() | public boolean | isSuccess() boolean Represents whether or not the allocation was a success. | public static AllocationResult | newAllocationResult(double rating, boolean success, AspectValue[] avs) Factory that takes a result in the form of AspectValues (NON-PHASED).
Subclasses of AspectValue, such as TypedQuantityAspectValue are allowed.
Parameters: rating - The confidence rating of this result. Parameters: success - Whether the allocationresult violated any preferences. Parameters: avs - The AspectValues(can be aspectvalue subclasses) that represent the results. | public static AllocationResult | newAllocationResult(double rating, boolean success, AspectValue[] rollupavs, Collection phasedresults) AllocationResult factory that takes a PHASED result in the form of AspectValues.
Subclasses of AspectValue, such as TypedQuantityAspectValue are allowed.
Parameters: rating - The confidence rating of this result. Parameters: success - Whether the allocationresult violated any preferences. Parameters: rollupavs - The Summary (or rolled up) AspectValues that represent the results. Parameters: phasedresults - A Collections of the phased results. | public static AllocationResult | newAllocationResult(AllocationResult ar1, AllocationResult ar2) Construct a merged AllocationResult containing AspectValues from
two AllocationResults. | public String | toString() |
AllocationResult | public AllocationResult(double rating, boolean success, AspectValue[] aspectvalues)(Code) | | Constructor that takes a result in the form of AspectValues (NON-PHASED).
Subclasses of AspectValue, such as TypedQuantityAspectValue are allowed.
Parameters: rating - The confidence rating of this result. Parameters: success - Whether the allocationresult violated any preferences. Parameters: aspectvalues - The AspectValues(can be aspectvalue subclasses) that represent the results. |
AllocationResult | public AllocationResult(double rating, boolean success, int[] keys, double[] values)(Code) | | |
AllocationResult | public AllocationResult(double rating, boolean success, AspectValue[] rollupavs, Enumeration allresults)(Code) | | Simple Constructor for a PHASED result
Parameters: rating - The confidence rating of this result. Parameters: success - Whether the allocationresult violated any preferences. Parameters: rollupavs - The Summary (or rolled up) AspectValues that represent the results. Parameters: allresults - An Enumeration of either AspectValue[]s or Collections. |
AllocationResult | public AllocationResult(double rating, boolean success, int[] keys, double[] values, Enumeration allresults)(Code) | | |
AllocationResult | public AllocationResult(double rating, boolean success, AspectValue[] rollupavs, Collection phasedresults)(Code) | | Constructor that takes a PHASED result in the form of AspectValues.
Subclasses of AspectValue, such as TypedQuantityAspectValue are allowed.
Parameters: rating - The confidence rating of this result. Parameters: success - Whether the allocationresult violated any preferences. Parameters: rollupavs - The Summary (or rolled up) AspectValues that represent the results. Parameters: phasedresults - A Collections of the phased results. The Collection should containone Collection or AspectValue[] of AspectValues for each phase of the results. |
AllocationResult | public AllocationResult(AllocationResult ar1, AllocationResult ar2)(Code) | | Construct a merged AllocationResult containing AspectValues from
two AllocationResults. If both arguments have the same aspects,
the values from the first (dominant) result are used. The result
is never phased.
|
addAuxiliaryQueryInfo | public void addAuxiliaryQueryInfo(int aqtype, String data)(Code) | | Set a single AuxiliaryQueryType and its data (String).
Parameters: aqtype - The AuxiliaryQueryType Parameters: data - The string associated with the AuxiliaryQueryType See Also: org.cougaar.planning.ldm.plan.AuxiliaryQueryType |
auxiliaryQuery | public String auxiliaryQuery(int aqtype)(Code) | | Return the String representing the auxilliary piece of data that
matches the query type given in the argument.
Parameters: aqtype - The AuxiliaryQueryType you want the data for. String The string representing the data matching the type requested Note: may return null if nothing was defined See Also: org.cougaar.planning.ldm.plan.AuxiliaryQueryType throws: IllegalArgumentException - if the int passed in as an argument is not a definedAuxiliaryQueryType |
convertToAVA | public static AspectValue[] convertToAVA(int[] types, double[] values)(Code) | | Utility method to help conversion of old code to new usage
|
getAspectTypeFromArray | public String getAspectTypeFromArray(int i)(Code) | | |
getAspectTypes | public int[] getAspectTypes()(Code) | | A Collection of AspectTypes representative of the type and
order of the aspects in each the result.
int[] The array of AspectTypes See Also: org.cougaar.planning.ldm.plan.AspectType See Also: |
getAspectTypesAsArray | public String[] getAspectTypesAsArray()(Code) | | |
getAspectValue | public AspectValue getAspectValue(int aspectType)(Code) | | Get the AspectValue of the result with the specified type *
|
getAspectValueResults | public AspectValue[] getAspectValueResults()(Code) | | A collection of AspectValues that represent the result for each
preference. Note that subclasses of AspectValue such as
TypedQuantityAspectValue may be used. If this was not
defined through a constructor, one will be built from the result
and aspecttype arrays. In this case only true AspectValue
objects will be build (no subclasses of AspectValues).
The AspectValues of a failed allocation may be set by the Allocator
with values that would be more likely to be successful.
The Expander can use these new values as suggestions when
resetting the Preferences.
|
getConfidenceRating | public double getConfidenceRating()(Code) | | double The confidence rating of this result. |
getPhasedAspectValueResults | public List getPhasedAspectValueResults()(Code) | | A List of Lists that represent each phased result in the form
of AspectValues.
If the result is not phased, use getAspectValueResults()
A List. If the AllocationResult is not phased, will return null. |
getPhasedResults | public Enumeration getPhasedResults()(Code) | | A collection of arrays that represents each phased result.
If the result is not phased, use AllocationResult.getResult()
Warning!!! Not all AspectValues can be simply represented as
a double. Use of this method with such AspectValues is undefined.
Enumeration |
getPhasedResultsAsArray | public double[][] getPhasedResultsAsArray()(Code) | | Return phased results.
Warning!!! Not all AspectValues can be simply represented as
a double. Use of this method with such AspectValues is undefined.
an array of an array of doubles |
getPhasedResultsFromArray | public double[] getPhasedResultsFromArray(int i)(Code) | | Return a particular phase of a phased result as an array of doubles.
Warning!!! Not all AspectValues can be simply represented as
a double. Use of this method with such AspectValues is undefined.
the i-th phase as double[] |
getResult | public double[] getResult()(Code) | | A collection of doubles that represent the result for each
AspectType. If the result is phased, the results are
summarized.
Warning!!! Not all AspectValues can be simply represented as
a double. Use of this method with such AspectValues is undefined.
double[] |
getResultFromArray | public String getResultFromArray(int i)(Code) | | |
getValue | public double getValue(int aspectType)(Code) | | Get the result with respect to a given AspectType.
If the AllocationResult is phased, this method will return
the summary value of the given AspectType.
Warning!!! Not all AspectValues can be simply represented as
a double. Use of this method with such AspectValues is undefined.
Parameters: aspectType - double The result of a given dimension. For example, getValue(AspectType.START_TIME) returns the Task start time.Note : results are not required to contain data in each dimension - check the array of defined aspecttypes or ask if a specificdimension is defined. If there is a request for a value of anundefined aspect, an IllegalArgumentException will be thrown. See Also: org.cougaar.planning.ldm.plan.AspectType |
isDefined | public boolean isDefined(int aspectType)(Code) | | Quick check to see if one aspect is defined as opposed to
looking through the AspectType array.
Parameters: aspectType - The aspect you are checking boolean Represents whether this aspect is defined See Also: org.cougaar.planning.ldm.plan.AspectType |
isEqual | public boolean isEqual(AllocationResult that)(Code) | | checks to see if the AllocationResult is equal to this one.
|
isPhased | public boolean isPhased()(Code) | | boolean Represents whether or not the allocationresult is phased. |
isSuccess | public boolean isSuccess()(Code) | | boolean Represents whether or not the allocation was a success. If any Constraints were violated by the allocation, then the isSuccess() method returns false and the Plugin that created the subtask shouldrecognize this event. The Expander may re-expand, change the Constraints or Preferences, or indicate failure to its superior. The AspectValues of a failed allocation may be set by the Allocatorwith values that would be more likely to be successful. The Expander can use these new values as suggestions when resetting the Preferences |
newAllocationResult | public static AllocationResult newAllocationResult(double rating, boolean success, AspectValue[] avs)(Code) | | Factory that takes a result in the form of AspectValues (NON-PHASED).
Subclasses of AspectValue, such as TypedQuantityAspectValue are allowed.
Parameters: rating - The confidence rating of this result. Parameters: success - Whether the allocationresult violated any preferences. Parameters: avs - The AspectValues(can be aspectvalue subclasses) that represent the results. |
newAllocationResult | public static AllocationResult newAllocationResult(double rating, boolean success, AspectValue[] rollupavs, Collection phasedresults)(Code) | | AllocationResult factory that takes a PHASED result in the form of AspectValues.
Subclasses of AspectValue, such as TypedQuantityAspectValue are allowed.
Parameters: rating - The confidence rating of this result. Parameters: success - Whether the allocationresult violated any preferences. Parameters: rollupavs - The Summary (or rolled up) AspectValues that represent the results. Parameters: phasedresults - A Collections of the phased results. The Collection should containone Collection or AspectValue[] of AspectValues for each phase of the results. |
newAllocationResult | public static AllocationResult newAllocationResult(AllocationResult ar1, AllocationResult ar2)(Code) | | Construct a merged AllocationResult containing AspectValues from
two AllocationResults. If both arguments have the same aspects,
the values from the first (dominant) result are used. The result
is never phased.
|
|
|