Java Doc for ScoringFunction.java in  » Science » Cougaar12_4 » org » cougaar » planning » ldm » plan » 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.planning.ldm.plan 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.cougaar.planning.ldm.plan.ScoringFunction

All known Subclasses:   org.cougaar.lib.util.UTILEndDateScoringFunction,  org.cougaar.glm.util.GLMLocationScoringFunction,
ScoringFunction
abstract public class ScoringFunction implements Serializable,Cloneable(Code)
Base class for functions which compute a Score value given an AspectValue. Score is a double where LOW_THRESHOLD (0.0) is "good"/"optimal" and HIGH_THRESHOLD (1.0) is "bad" (as bad as it gets). ScoringFunction domains should be infinite and Range should be 0.0 to 1.0 inclusive.

Inner Class :public static class PiecewiseLinearScoringFunction extends ScoringFunction
Inner Class :abstract public static class SinglePointScoringFunction extends ScoringFunction
Inner Class :public static class StrictValueScoringFunction extends SinglePointScoringFunction
Inner Class :public static class PreferredValueScoringFunction extends SinglePointScoringFunction
Inner Class :abstract public static class TwoPointScoringFunction extends ScoringFunction
Inner Class :public static class VScoringFunction extends TwoPointScoringFunction
Inner Class :public static class StrictBetweenScoringFunction extends TwoPointScoringFunction
Inner Class :public static class StrictBetweenWithBest extends StrictBetweenScoringFunction
Inner Class :public static class PreferredBetweenScoringFunction extends TwoPointScoringFunction
Inner Class :public static class AboveScoringFunction extends SinglePointScoringFunction
Inner Class :public static class BelowScoringFunction extends SinglePointScoringFunction
Inner Class :public static class StepScoringFunction extends SinglePointScoringFunction
Inner Class :public static class EnumeratedScoringFunction extends ScoringFunction
Inner Class :public static class ConstantScoringFunction extends ScoringFunction

Field Summary
final public static  doubleBEST
    
final public static  doubleHIGH_THRESHOLD
    
final public static  doubleLOW_THRESHOLD
    
final public static  doubleNOVALUE
     A Value to be used when the Score is undefined, equivalent to Double.NaN.
final public static  doubleOK
    
final public static  doubleWORST
    
protected  intaspectType
    

Constructor Summary
protected  ScoringFunction(int type)
    

Method Summary
final static  double_interpY(double px, double x1, double y1, double x2, double y2)
     interpolate a Y given an X and a line segment.
final  AspectScorePoint_maxY(double minx, double maxx, double x1, double y1, double x2, double y2)
     return an AspectScorePoint for the maximum y of the segment ((x1,y1) (x2, y2)) in the range of minx-maxx.
final  AspectScorePoint_minY(double minx, double maxx, double x1, double y1, double x2, double y2)
     return an AspectScorePoint for the minimum y of the segment ((x1,y1) (x2, y2)) in the range of minx-maxx.
final public static  voidcheckValidCurve(AspectScorePoint[] curve)
     Check a set of AspectScorePoints for validity as the "curve" of PiecewiseLinearScoringFunction.
abstract public  Objectclone()
    
final public static  ScoringFunctioncreateConstantScoringFunction(double score, int type)
    
final public static  ScoringFunctioncreateConstantScoringFunction(AspectScorePoint score)
    
final public static  ScoringFunctioncreateEnumerated(AspectScorePoint[] points)
     Select specific enumerated points where score is allowed : disallowed (above threshold) at all other points.
final public static  ScoringFunctioncreateNearOrAbove(AspectValue value, double slope)
     Prefer as close as possible to value from above The score at the inflection point is BEST
Parameters:
  value - The point.
final public static  ScoringFunctioncreateNearOrBelow(AspectValue value, double slope)
     Prefer as close as possible to value from below The score at the inflection point is BEST;
Parameters:
  value - The point.
final public static  ScoringFunctioncreatePiecewiseLinearScoringFunction(Enumeration points)
    
final public static  ScoringFunctioncreatePiecewiseLinearScoringFunction(AspectScorePoint[] points)
     Create a ScoringFunction from a set of AspectScorePoints.
final public static  ScoringFunctioncreatePreferredAtValue(AspectValue value, double slope)
     A single point with slanted sides in score space
Parameters:
  value - The single point.
final public static  ScoringFunctioncreatePreferredBetweenValues(AspectValue low, AspectValue high, double slope)
     A flat basin with slanted sides
Parameters:
  low - The low point.
Parameters:
  high - The high point.
final public static  ScoringFunctioncreateStepScoringFunction(AspectValue changepoint, double prescore, double postscore)
    
final public static  ScoringFunctioncreateStrictlyAtValue(AspectValue value)
     A single point with straight sides in score space
Parameters:
  value - The single point.
final public static  ScoringFunctioncreateStrictlyBetweenValues(AspectValue low, AspectValue high)
     A flat basin with straight sides. BEST defaults to low point.
Parameters:
  low - The low point.
Parameters:
  high - The high point.
final public static  ScoringFunctioncreateStrictlyBetweenWithBestValues(AspectValue low, AspectValue best, AspectValue high)
     A flat basin with straight sides. Just like StrictBetweenScoringFunction, except that BEST point is specified, even though the Scores of low, best and high are all actually the same.
Parameters:
  low - The low point.
Parameters:
  best - The preferred point.
Parameters:
  high - The high point.
final public static  ScoringFunctioncreateVScoringFunction(AspectValue low, AspectValue best, AspectValue high)
     A typical V-shaped scoring function. low and high values are OK, best is BEST, score is linear betwen low and best, best and high. anything outside the range is WORST. The best point need not be centered between low and high.
Parameters:
  low - The low point.
Parameters:
  best - The best point.
Parameters:
  high - The high point.
final public static  ScoringFunctioncreateVScoringFunction(AspectValue low, AspectValue best, AspectValue high, double ok)
     like createVScoringFunction(low,best,high) except allows specification of value of OK value.
abstract public  AspectScorePointgetBest()
     Find the/a "Best" value of the function.
public  AspectScoreRangegetDefinedRange()
    
abstract public  AspectScorePointgetMaxInRange(AspectValue lowerbound, AspectValue upperbound)
     Find the/a "Worst" value within a range.
abstract public  AspectScorePointgetMinInRange(AspectValue lowerbound, AspectValue upperbound)
     Find the/a "Best" value within a range.
abstract public  doublegetScore(AspectValue value)
     Find the Score at a point.
abstract public  EnumerationgetValidRanges(AspectValue lowerbound, AspectValue upperbound)
     Find all non-1.0 (worst) value ranges within boundaries.
public static  voidmain(String[] args)
    
final protected static  AspectScorePointnewASP(double value, double score, int type)
    

Field Detail
BEST
final public static double BEST(Code)
"Best" Score *



HIGH_THRESHOLD
final public static double HIGH_THRESHOLD(Code)
Maximum valid value *



LOW_THRESHOLD
final public static double LOW_THRESHOLD(Code)
Minimum valid value *



NOVALUE
final public static double NOVALUE(Code)
A Value to be used when the Score is undefined, equivalent to Double.NaN.



OK
final public static double OK(Code)
Typical "Satisfactory" value *



WORST
final public static double WORST(Code)
"Worst" Score *



aspectType
protected int aspectType(Code)




Constructor Detail
ScoringFunction
protected ScoringFunction(int type)(Code)




Method Detail
_interpY
final static double _interpY(double px, double x1, double y1, double x2, double y2)(Code)
interpolate a Y given an X and a line segment. px must be in the range.



_maxY
final AspectScorePoint _maxY(double minx, double maxx, double x1, double y1, double x2, double y2)(Code)
return an AspectScorePoint for the maximum y of the segment ((x1,y1) (x2, y2)) in the range of minx-maxx. BEST if out of range.



_minY
final AspectScorePoint _minY(double minx, double maxx, double x1, double y1, double x2, double y2)(Code)
return an AspectScorePoint for the minimum y of the segment ((x1,y1) (x2, y2)) in the range of minx-maxx. WORST if out of range.



checkValidCurve
final public static void checkValidCurve(AspectScorePoint[] curve)(Code)
Check a set of AspectScorePoints for validity as the "curve" of PiecewiseLinearScoringFunction. Tests used are: must have at least 2 points, all points must have the AspectType, values must be strictly increasing, scores may not be negative.
throws:
  IllegalArgumentException - on illegal curve.



clone
abstract public Object clone()(Code)



createConstantScoringFunction
final public static ScoringFunction createConstantScoringFunction(double score, int type)(Code)
Constant function always has same score
Parameters:
  score - - the score for all values



createConstantScoringFunction
final public static ScoringFunction createConstantScoringFunction(AspectScorePoint score)(Code)
Constant function always has same score
Parameters:
  score - - the score for all values



createEnumerated
final public static ScoringFunction createEnumerated(AspectScorePoint[] points)(Code)
Select specific enumerated points where score is allowed : disallowed (above threshold) at all other points. Note : The implementation ignores range, as enumerations have no sense of comparison or continuity.
Parameters:
  points - array of AspectScorePoints of allowable points



createNearOrAbove
final public static ScoringFunction createNearOrAbove(AspectValue value, double slope)(Code)
Prefer as close as possible to value from above The score at the inflection point is BEST
Parameters:
  value - The point. AboveScoringFunction



createNearOrBelow
final public static ScoringFunction createNearOrBelow(AspectValue value, double slope)(Code)
Prefer as close as possible to value from below The score at the inflection point is BEST;
Parameters:
  value - The point. BelowScoringFunction



createPiecewiseLinearScoringFunction
final public static ScoringFunction createPiecewiseLinearScoringFunction(Enumeration points)(Code)
Create a ScoringFunction from a set of AspectScorePoints
Parameters:
  points - A set of AspectScorePoints which define the curve of the function.



createPiecewiseLinearScoringFunction
final public static ScoringFunction createPiecewiseLinearScoringFunction(AspectScorePoint[] points)(Code)
Create a ScoringFunction from a set of AspectScorePoints. The parameter will not be copied, so the points must never be modified.
Parameters:
  points - A set of AspectScorePoints which define the curve of the function.



createPreferredAtValue
final public static ScoringFunction createPreferredAtValue(AspectValue value, double slope)(Code)
A single point with slanted sides in score space
Parameters:
  value - The single point. PreferredValueScoringFunction



createPreferredBetweenValues
final public static ScoringFunction createPreferredBetweenValues(AspectValue low, AspectValue high, double slope)(Code)
A flat basin with slanted sides
Parameters:
  low - The low point.
Parameters:
  high - The high point. PreferredBetweenScoringFunction



createStepScoringFunction
final public static ScoringFunction createStepScoringFunction(AspectValue changepoint, double prescore, double postscore)(Code)
Step function The score exactly at the inflection point is BEST
Parameters:
  changepoint -
Parameters:
  prescore -
Parameters:
  postscore -



createStrictlyAtValue
final public static ScoringFunction createStrictlyAtValue(AspectValue value)(Code)
A single point with straight sides in score space
Parameters:
  value - The single point. StrictValueScoringFunction



createStrictlyBetweenValues
final public static ScoringFunction createStrictlyBetweenValues(AspectValue low, AspectValue high)(Code)
A flat basin with straight sides. BEST defaults to low point.
Parameters:
  low - The low point.
Parameters:
  high - The high point. StrictBetweenScoringFunction



createStrictlyBetweenWithBestValues
final public static ScoringFunction createStrictlyBetweenWithBestValues(AspectValue low, AspectValue best, AspectValue high)(Code)
A flat basin with straight sides. Just like StrictBetweenScoringFunction, except that BEST point is specified, even though the Scores of low, best and high are all actually the same.
Parameters:
  low - The low point.
Parameters:
  best - The preferred point.
Parameters:
  high - The high point. StrictBetweenWithBest



createVScoringFunction
final public static ScoringFunction createVScoringFunction(AspectValue low, AspectValue best, AspectValue high)(Code)
A typical V-shaped scoring function. low and high values are OK, best is BEST, score is linear betwen low and best, best and high. anything outside the range is WORST. The best point need not be centered between low and high.
Parameters:
  low - The low point.
Parameters:
  best - The best point.
Parameters:
  high - The high point. VScoringFunction



createVScoringFunction
final public static ScoringFunction createVScoringFunction(AspectValue low, AspectValue best, AspectValue high, double ok)(Code)
like createVScoringFunction(low,best,high) except allows specification of value of OK value.



getBest
abstract public AspectScorePoint getBest()(Code)
Find the/a "Best" value of the function. Can be used as a starting point for an allocator. If not implemented, returns null. AspectScorePoint May be null if uncomputable.



getDefinedRange
public AspectScoreRange getDefinedRange()(Code)
the range over which the scoring function is defined.Note that "undefined" == "undifferentiated WORST" score.Will always return a non-null value, but one or both values ofthe range may an AspectScorePoing infinity, indicating unbounded range.There may be any amount of score variation, including WORST pointswithin this range.



getMaxInRange
abstract public AspectScorePoint getMaxInRange(AspectValue lowerbound, AspectValue upperbound)(Code)
Find the/a "Worst" value within a range. Specify AspectValue boundaries within the function and get the maximum value within those boundaries. If not implemented, returns null.
Parameters:
  lowerbound -
Parameters:
  upperbound - AspectScorePoint May be null if uncomputable.



getMinInRange
abstract public AspectScorePoint getMinInRange(AspectValue lowerbound, AspectValue upperbound)(Code)
Find the/a "Best" value within a range. Specify AspectValue boundaries within the function and get the minimum value within those boundaries. If not implemented, returns null.
Parameters:
  lowerbound -
Parameters:
  upperbound - AspectScorePoint May be null if uncomputable.



getScore
abstract public double getScore(AspectValue value)(Code)
Find the Score at a point. 1.0 is worst, 0.0 is best.
Parameters:
  value - double The score given an AspectValue.
See Also:   org.cougaar.planning.ldm.plan.AspectValue



getValidRanges
abstract public Enumeration getValidRanges(AspectValue lowerbound, AspectValue upperbound)(Code)
Find all non-1.0 (worst) value ranges within boundaries. Specify AspectValue boundaries within the function and get the the valid ranges of values within those boundaries. If not implemented, returns null.
Parameters:
  lowerbound -
Parameters:
  upperbound - Enumeration{AspectScoreRange} may be null if uncomputable.



main
public static void main(String[] args)(Code)



newASP
final protected static AspectScorePoint newASP(double value, double score, int type)(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.