| java.lang.Object org.cougaar.lib.util.UTILPreference
All known Subclasses: org.cougaar.glm.util.GLMPreference,
UTILPreference | public class UTILPreference (Code) | | This class contains preference-related methods.
Can ask basic questions like ready at, early, best, and latest date for
tasks.
Can also create an various kinds of preferences.
|
Method Summary | |
public Date | getBestDate(Task t) Returns the desired best arrival date from task object or null if
that date is null. | public double | getCost(Task t) get the Cost preference of a task. | public Date | getEarlyDate(Task t) Returns the desired earliest arrival date from task object or null if
that date is null. | protected UTILEndDateScoringFunction | getEndDateSF(Task t) | public Date | getLateDate(Task t) Returns the desired latest arrival date from task object or null if
that date is null. | public Date | getPODDate(Task t) | public Preference | getPrefWithAspectType(Task taskToExamine, int aspect_type) | public AspectValue | getPreferenceBestAspectValue(Preference pref) | public double | getPreferenceBestValue(Preference pref) | public long | getQuantity(Task t) get the Quantity preference of a task. | public Date | getReadyAt(Task t) | public double | getReportedAspectValue(PlanElement pe, int aspectType) | public double | getReportedCost(PlanElement pe) | public Date | getReportedEndDate(PlanElement pe) | public Date | getReportedEndDate(AllocationResult ar) | public Date | getReportedPODDate(PlanElement pe) | public Date | getReportedPODDate(AllocationResult result) | public long | getReportedQuantity(PlanElement pe) | public Date | getReportedReadyAt(PlanElement pe) | protected Enumeration | getValidEndDateRanges(Task t) | protected Enumeration | getValidEndDateRanges(Preference endDatePref) | public boolean | hasPrefWithAspectType(Task taskToExamine, int aspectType) | public Preference | makeCostPreference(PlanningFactory ldmf, double cost) This call generates a cost preference. | public Preference | makeEndDateBelowPreference(PlanningFactory ldmf, Date bestDate) | public Preference | makeEndDatePreference(PlanningFactory ldmf, Date earlyDate, Date bestDate, Date lateDate) Generates a preference from 3 dates. | public Preference | makeEndDatePreference(PlanningFactory ldmf, Date bestDate) When you don't know early or latest, only best time for the task. | public Preference | makePODDatePreference(PlanningFactory ldmf, Date bestDate) What should we do with the weight of the preference?
Should this be set by a policy object?
Note that it uses one day as the slope -- i.e. | public Preference | makeQuantityPreference(PlanningFactory ldmf, long quantity) Generates a quantity preference. | public Preference | makeStartDatePreference(PlanningFactory ldmf, Date readyAtDate) Generates a preference from 1 date. | public Preference | removePrefWithAspectType(Task taskToChange, int aspect_type) | public void | replacePreference(NewTask t, Preference new_pref) | public Vector | replacePreference(Vector old_prefs, Preference new_pref) |
NO_ASPECT_VALUE | public double NO_ASPECT_VALUE(Code) | | |
startDateCache | protected Map startDateCache(Code) | | |
getBestDate | public Date getBestDate(Task t)(Code) | | Returns the desired best arrival date from task object or null if
that date is null.
Should work with both TOPSEndDates and end dates generated from outside of TOPS.
Parameters: t - - the Task object Date |
getCost | public double getCost(Task t)(Code) | | get the Cost preference of a task.
Parameters: t - the Task object date at which task is ready |
getEarlyDate | public Date getEarlyDate(Task t)(Code) | | Returns the desired earliest arrival date from task object or null if
that date is null.
Should work with both TOPSEndDates and end dates generated from outside of TOPS.
If not an TOPSEndDate, then looks at the valid ranges for the scoring function,
gets the first one, and returns its start point.
Parameters: t - - the Task object Date |
getLateDate | public Date getLateDate(Task t)(Code) | | Returns the desired latest arrival date from task object or null if
that date is null.
Should work with both TOPSEndDates and end dates generated from outside of TOPS.
If not an TOPSEndDate, then looks at the valid ranges for the scoring function,
gets the last one, and returns its end point.
Parameters: t - - the Task object Date |
getPODDate | public Date getPODDate(Task t)(Code) | | Returns the POD Date from task object, null if POD date not a pref on this task
Parameters: t - the Task with the pref point of departure date for task, null if no POD date pref |
getPrefWithAspectType | public Preference getPrefWithAspectType(Task taskToExamine, int aspect_type)(Code) | | Utility function to get preference from a task based on its aspect type
Parameters: taskToExamine - task to examine for matching preference Parameters: aspect_type - aspect type you're hoping to find on the task's preference list Preference first preference found (earliest in pref enum) with thespecified aspect type, null if none found |
getPreferenceBestAspectValue | public AspectValue getPreferenceBestAspectValue(Preference pref)(Code) | | Given a Preference get its best aspect value
Parameters: pref - the preference to examine double best aspect value for the preference |
getPreferenceBestValue | public double getPreferenceBestValue(Preference pref)(Code) | | Given a Preference get its best aspect value
Parameters: pref - the preference to examine double best aspect value for the preference |
getQuantity | public long getQuantity(Task t)(Code) | | get the Quantity preference of a task.
Parameters: t - the Task object date at which task is ready |
getReadyAt | public Date getReadyAt(Task t)(Code) | | Returns the READYAT Date from task object, or new Date if READYAT
date is null
Parameters: t - the Task object date at which task is ready |
getReportedAspectValue | public double getReportedAspectValue(PlanElement pe, int aspectType)(Code) | | Examine plan element for a reported aspect value
Many times easier to use type specific variants -- like getReportedReadyAt
|
getReportedCost | public double getReportedCost(PlanElement pe)(Code) | | Get reported cost from plan element
|
getReportedEndDate | public Date getReportedEndDate(PlanElement pe)(Code) | | Get reported End date from plan element
|
getReportedPODDate | public Date getReportedPODDate(PlanElement pe)(Code) | | Get reported POD date from plan element
|
getReportedQuantity | public long getReportedQuantity(PlanElement pe)(Code) | | Get reported quantity from plan element
|
getReportedReadyAt | public Date getReportedReadyAt(PlanElement pe)(Code) | | Get reported ready at date from plan element
|
hasPrefWithAspectType | public boolean hasPrefWithAspectType(Task taskToExamine, int aspectType)(Code) | | true if task has specified aspect type |
makeCostPreference | public Preference makeCostPreference(PlanningFactory ldmf, double cost)(Code) | | This call generates a cost preference. Only using a single value.
Should probably be more complex than this.
Parameters: ldmf - the PlanningFactory Parameters: cost - the single cost value Preference |
makeEndDatePreference | public Preference makeEndDatePreference(PlanningFactory ldmf, Date earlyDate, Date bestDate, Date lateDate)(Code) | | Generates a preference from 3 dates.
What should we do with the weight of the preference?
Should this be set by a policy object?
What should be the relative scores of early and late?
Uses the endDateCache so only distinct instances are created.
Parameters: earlyDate - - the earliest possible date Parameters: bestDate - - the best date Parameters: lateDate - - the latest possible date Preference |
makeEndDatePreference | public Preference makeEndDatePreference(PlanningFactory ldmf, Date bestDate)(Code) | | When you don't know early or latest, only best time for the task.
What should we do with the weight of the preference?
Should this be set by a policy object?
Note that it uses one day as the slope -- i.e.
a day after the bestDate, the pref is exceeded.
Parameters: bestDate - - the best date Preference |
makePODDatePreference | public Preference makePODDatePreference(PlanningFactory ldmf, Date bestDate)(Code) | | What should we do with the weight of the preference?
Should this be set by a policy object?
Note that it uses one day as the slope -- i.e.
a day after the POD date, the pref is exceeded.
|
makeQuantityPreference | public Preference makeQuantityPreference(PlanningFactory ldmf, long quantity)(Code) | | Generates a quantity preference.
What should we do with the weight of the preference?
Should this be set by a policy object?
Parameters: quantity - desired Preference |
makeStartDatePreference | public Preference makeStartDatePreference(PlanningFactory ldmf, Date readyAtDate)(Code) | | Generates a preference from 1 date.
What should we do with the weight of the preference?
Should this be set by a policy object?
Uses the startDateCache so only distinct instances are created.
Parameters: readyAtDate - - the date item is ready to move Preference |
removePrefWithAspectType | public Preference removePrefWithAspectType(Task taskToChange, int aspect_type)(Code) | | Utility function to remove pref from a task based on its aspect type
Parameters: taskToChange - task to examine for matching preference Parameters: aspect_type - aspect type you're hoping to find on the task's pref list Preference last preference found (latest in pref enum) with thespecified aspect type, null if none foundNOTE that if more than one pref with this aspect type is found, ALL are removed but only the latest is returned. |
|
|