edu.indiana.iucbrf.feature.unknown
Class DefaultDifference

java.lang.Object
  extended by edu.indiana.iucbrf.feature.unknown.DefaultDifference
All Implemented Interfaces:
UnknownFeatureHandler, java.io.Serializable

public class DefaultDifference
extends java.lang.Object
implements UnknownFeatureHandler

Provides a default difference between two features, when the value of at least one of them is not known.

See Also:
Serialized Form

Field Summary
protected  boolean debugMode
           
protected  double defaultDiff
          The default difference, to be used for any feature for which no specific mapping value is provided.
protected  DoubleMap defaultDiffMap
          Exceptions to the defaultDiff member variable above, for specified features.
 
Constructor Summary
protected DefaultDifference()
           
  DefaultDifference(double defaultDiff)
          Creates a new instance of DefaultDifference
  DefaultDifference(double defaultDiff, DoubleMap defaultDiffMap)
           
 
Method Summary
 double differenceOfUnknownFeature(Problem p1, Problem p2, FeatureKey featureOfInterest)
           
 double differenceOfUnknownFeature(Problem p1, Problem p2, FeatureKey featureOfInterest, java.util.Collection indicesToUse)
          Estimate the difference between p1[featureOfInterest] and p2[featureOfInterest] given that one or both values may be missing, optionally making use of indicesToUse in this calculation.
 boolean equals(java.lang.Object other)
           
 java.lang.String getAbbreviatedName()
          The abbreviated name of this unknown feature handler.
 boolean getDebugMode()
           
 java.lang.String getName()
          The name of this unknown feature handler.
 int hashCode()
           
 void setDebugMode(boolean debugMode)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultDiff

protected double defaultDiff
The default difference, to be used for any feature for which no specific mapping value is provided.


defaultDiffMap

protected DoubleMap defaultDiffMap
Exceptions to the defaultDiff member variable above, for specified features.


debugMode

protected boolean debugMode
Constructor Detail

DefaultDifference

protected DefaultDifference()

DefaultDifference

public DefaultDifference(double defaultDiff)
Creates a new instance of DefaultDifference


DefaultDifference

public DefaultDifference(double defaultDiff,
                         DoubleMap defaultDiffMap)
Method Detail

differenceOfUnknownFeature

public double differenceOfUnknownFeature(Problem p1,
                                         Problem p2,
                                         FeatureKey featureOfInterest,
                                         java.util.Collection indicesToUse)
Description copied from interface: UnknownFeatureHandler
Estimate the difference between p1[featureOfInterest] and p2[featureOfInterest] given that one or both values may be missing, optionally making use of indicesToUse in this calculation.

Specified by:
differenceOfUnknownFeature in interface UnknownFeatureHandler

differenceOfUnknownFeature

public double differenceOfUnknownFeature(Problem p1,
                                         Problem p2,
                                         FeatureKey featureOfInterest)

getName

public java.lang.String getName()
The name of this unknown feature handler.

Specified by:
getName in interface UnknownFeatureHandler

getAbbreviatedName

public java.lang.String getAbbreviatedName()
The abbreviated name of this unknown feature handler.

Specified by:
getAbbreviatedName in interface UnknownFeatureHandler

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getDebugMode

public boolean getDebugMode()
Specified by:
getDebugMode in interface UnknownFeatureHandler

setDebugMode

public void setDebugMode(boolean debugMode)
Specified by:
setDebugMode in interface UnknownFeatureHandler