Java Doc for UTILPreference.java in  » Science » Cougaar12_4 » org » cougaar » lib » util » 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.lib.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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.


Field Summary
public  doubleNO_ASPECT_VALUE
    
protected  MapendDateCache
    
protected  Loggerlogger
    
protected  MapstartDateCache
    

Constructor Summary
public  UTILPreference(Logger l)
    

Method Summary
public  DategetBestDate(Task t)
     Returns the desired best arrival date from task object or null if that date is null.
public  doublegetCost(Task t)
     get the Cost preference of a task.
public  DategetEarlyDate(Task t)
     Returns the desired earliest arrival date from task object or null if that date is null.
protected  UTILEndDateScoringFunctiongetEndDateSF(Task t)
    
public  DategetLateDate(Task t)
     Returns the desired latest arrival date from task object or null if that date is null.
public  DategetPODDate(Task t)
    
public  PreferencegetPrefWithAspectType(Task taskToExamine, int aspect_type)
    
public  AspectValuegetPreferenceBestAspectValue(Preference pref)
    
public  doublegetPreferenceBestValue(Preference pref)
    
public  longgetQuantity(Task t)
     get the Quantity preference of a task.
public  DategetReadyAt(Task t)
    
public  doublegetReportedAspectValue(PlanElement pe, int aspectType)
    
public  doublegetReportedCost(PlanElement pe)
    
public  DategetReportedEndDate(PlanElement pe)
    
public  DategetReportedEndDate(AllocationResult ar)
    
public  DategetReportedPODDate(PlanElement pe)
    
public  DategetReportedPODDate(AllocationResult result)
    
public  longgetReportedQuantity(PlanElement pe)
    
public  DategetReportedReadyAt(PlanElement pe)
    
protected  EnumerationgetValidEndDateRanges(Task t)
    
protected  EnumerationgetValidEndDateRanges(Preference endDatePref)
    
public  booleanhasPrefWithAspectType(Task taskToExamine, int aspectType)
    
public  PreferencemakeCostPreference(PlanningFactory ldmf, double cost)
     This call generates a cost preference.
public  PreferencemakeEndDateBelowPreference(PlanningFactory ldmf, Date bestDate)
    
public  PreferencemakeEndDatePreference(PlanningFactory ldmf, Date earlyDate, Date bestDate, Date lateDate)
     Generates a preference from 3 dates.
public  PreferencemakeEndDatePreference(PlanningFactory ldmf, Date bestDate)
     When you don't know early or latest, only best time for the task.
public  PreferencemakePODDatePreference(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  PreferencemakeQuantityPreference(PlanningFactory ldmf, long quantity)
     Generates a quantity preference.
public  PreferencemakeStartDatePreference(PlanningFactory ldmf, Date readyAtDate)
     Generates a preference from 1 date.
public  PreferenceremovePrefWithAspectType(Task taskToChange, int aspect_type)
    
public  voidreplacePreference(NewTask t, Preference new_pref)
    
public  VectorreplacePreference(Vector old_prefs, Preference new_pref)
    

Field Detail
NO_ASPECT_VALUE
public double NO_ASPECT_VALUE(Code)



endDateCache
protected Map endDateCache(Code)



logger
protected Logger logger(Code)



startDateCache
protected Map startDateCache(Code)




Constructor Detail
UTILPreference
public UTILPreference(Logger l)(Code)




Method Detail
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



getEndDateSF
protected UTILEndDateScoringFunction getEndDateSF(Task t)(Code)



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



getReportedEndDate
public Date getReportedEndDate(AllocationResult ar)(Code)
Get reported End date from allocation result



getReportedPODDate
public Date getReportedPODDate(PlanElement pe)(Code)
Get reported POD date from plan element



getReportedPODDate
public Date getReportedPODDate(AllocationResult result)(Code)
Get reported POD date from allocation result



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



getValidEndDateRanges
protected Enumeration getValidEndDateRanges(Task t)(Code)



getValidEndDateRanges
protected Enumeration getValidEndDateRanges(Preference endDatePref)(Code)



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



makeEndDateBelowPreference
public Preference makeEndDateBelowPreference(PlanningFactory ldmf, Date bestDate)(Code)



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.



replacePreference
public void replacePreference(NewTask t, Preference new_pref)(Code)
Utility methods



replacePreference
public Vector replacePreference(Vector old_prefs, Preference new_pref)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.