edu.washington.cs.supple.render.utility
Class FactorStatistics

java.lang.Object
  extended byedu.washington.cs.supple.render.utility.FactorStatistics
All Implemented Interfaces:
java.io.Serializable

public class FactorStatistics
extends java.lang.Object
implements java.io.Serializable

Author:
kgajos Used to report and store statistics about contributions of different factors to the total cost of a solution
See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable stats
           
 
Constructor Summary
FactorStatistics()
           
 
Method Summary
 java.lang.String getMaxDifferenceFactorName(FactorStatistics stats2)
          Compares this factor statistics with another one and returns the factor name that has the biggest difference between the two
 java.lang.String getMaxFactorName(FactorStatistics stats2)
          Compares this factor statistics with another one and returns the factor name that has the biggest statistics between the two
 float getStatistics(java.lang.String factorName)
          Allows you to retrieve statistics for a factor
 java.lang.String prettyPrint()
          Returns a nicely formatted string summarizing factor statistics
 void putStatistics(java.lang.String factorName, float contribution)
          allows you to store statistics for a factor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stats

protected java.util.Hashtable stats
Constructor Detail

FactorStatistics

public FactorStatistics()
Method Detail

putStatistics

public void putStatistics(java.lang.String factorName,
                          float contribution)
allows you to store statistics for a factor

Parameters:
factorName - name of a factor
contribution - statistics for that factor

getStatistics

public float getStatistics(java.lang.String factorName)
Allows you to retrieve statistics for a factor

Parameters:
factorName - name of a factor
Returns:
statistics for that factor (or 0 if the factor's statistics have not been found)

getMaxDifferenceFactorName

public java.lang.String getMaxDifferenceFactorName(FactorStatistics stats2)
Compares this factor statistics with another one and returns the factor name that has the biggest difference between the two

Parameters:
stats2 - the other statistics
Returns:
the name of the factor with the largest difference

getMaxFactorName

public java.lang.String getMaxFactorName(FactorStatistics stats2)
Compares this factor statistics with another one and returns the factor name that has the biggest statistics between the two

Parameters:
stats2 - the other statistics
Returns:
the name of the factor with the largest value in either statistics

prettyPrint

public java.lang.String prettyPrint()
Returns a nicely formatted string summarizing factor statistics