|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.indiana.iucbrf.problem.differentiator.AbstractProblemDifferentiator
public abstract class AbstractProblemDifferentiator
An abstract implementation of the ProblemDifferentiator interface.
| Field Summary | |
|---|---|
protected java.util.HashSet |
defaultIndices
The set of index keys (the problem features used in some types of case base organization). |
protected java.util.HashMap |
keyToFeatureDifferentiator
A map from FeatureKey to FeatureDifferentiator, that will override the default FeatureDifferentiator (returned by the FeatureSpec's getDefaultFeatureDifferentiator()) for a Feature's variable type (defined in Feature.getDefaultVariableType()). |
protected DoubleCollection |
similarityWts
Similarity weights indicate the relative importance of each problem feature in similarity comparisons. |
protected UnknownFeatureHandler |
unknownFeatureHandler
|
| Constructor Summary | |
|---|---|
protected |
AbstractProblemDifferentiator()
|
|
AbstractProblemDifferentiator(DoubleCollection similarityWts,
java.util.HashSet defaultIndices,
Domain domain)
Creates a new instance of AbstractProblemDifferentiator |
|
AbstractProblemDifferentiator(DoubleCollection similarityWts,
java.util.HashSet defaultIndices,
UnknownFeatureHandler unknownFeatureHandler,
Domain domain)
Creates a new instance of AbstractProblemDifferentiator |
| Method Summary | |
|---|---|
void |
addSimilarityWeight(FeatureKey featureKey,
double similarityWeight)
|
double |
calcDifference(java.lang.Object obj1,
java.lang.Object obj2)
|
double |
calcDifference(java.lang.Object obj1,
java.lang.Object obj2,
java.util.Collection indicesToUse)
|
protected abstract double |
calcDifference(Problem p1,
Problem p2,
java.util.Collection indicesToUse)
|
java.util.Iterator |
defaultIndicesIterator()
|
boolean |
equals(java.lang.Object other)
|
java.util.HashSet |
getDefaultIndices()
|
FeatureDifferentiator |
getFeatureDifferentiator(FeatureKey key)
Get the feature differentiator for the given feature. |
int |
getIndexCount()
|
DoubleCollection |
getSimilarityWeights()
|
UnknownFeatureHandler |
getUnknownFeatureHandler()
|
int |
hashCode()
|
boolean |
isIndex(FeatureKey key)
|
void |
removeFeature(FeatureKey featureKey)
|
void |
setIsIndex(FeatureKey key,
boolean isIndex)
|
void |
setOverridingFeatureDifferentiator(FeatureKey key,
FeatureDifferentiator featureDifferentiator)
Set the feature differentiator for a feature for this problem differentiator to be not the one based on the variable type (as defined in Feature.getDefaultVariableType()), but instead a customized one. |
void |
setToDefaultFeatureDifferentiator(Domain domain,
FeatureKey key)
Set the feature differentiator to the default for this feature type. |
void |
setToDefaultFeatureDifferentiator(FeatureSpec spec)
Set the feature differentiator to the default for this feature type. |
void |
setUnknownFeatureHandler(UnknownFeatureHandler unknownFeatureHandler)
|
protected void |
setupDefaultFeatureDifferentiators(Domain domain)
Setup the default feature differentiators for any features already in the domain. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected UnknownFeatureHandler unknownFeatureHandler
protected DoubleCollection similarityWts
protected java.util.HashSet defaultIndices
protected java.util.HashMap keyToFeatureDifferentiator
| Constructor Detail |
|---|
protected AbstractProblemDifferentiator()
public AbstractProblemDifferentiator(DoubleCollection similarityWts,
java.util.HashSet defaultIndices,
Domain domain)
public AbstractProblemDifferentiator(DoubleCollection similarityWts,
java.util.HashSet defaultIndices,
UnknownFeatureHandler unknownFeatureHandler,
Domain domain)
| Method Detail |
|---|
protected void setupDefaultFeatureDifferentiators(Domain domain)
public void setIsIndex(FeatureKey key,
boolean isIndex)
setIsIndex in interface ProblemDifferentiatorpublic boolean isIndex(FeatureKey key)
isIndex in interface ProblemDifferentiatorpublic void removeFeature(FeatureKey featureKey)
removeFeature in interface ProblemDifferentiatorpublic DoubleCollection getSimilarityWeights()
getSimilarityWeights in interface ProblemDifferentiatorpublic java.util.HashSet getDefaultIndices()
getDefaultIndices in interface ProblemDifferentiator
public void addSimilarityWeight(FeatureKey featureKey,
double similarityWeight)
addSimilarityWeight in interface ProblemDifferentiator
public double calcDifference(java.lang.Object obj1,
java.lang.Object obj2)
calcDifference in interface ProblemDifferentiatorcalcDifference in interface Differentiator
public double calcDifference(java.lang.Object obj1,
java.lang.Object obj2,
java.util.Collection indicesToUse)
calcDifference in interface ProblemDifferentiator
protected abstract double calcDifference(Problem p1,
Problem p2,
java.util.Collection indicesToUse)
public int getIndexCount()
getIndexCount in interface ProblemDifferentiatorpublic java.util.Iterator defaultIndicesIterator()
defaultIndicesIterator in interface ProblemDifferentiatorpublic void setUnknownFeatureHandler(UnknownFeatureHandler unknownFeatureHandler)
setUnknownFeatureHandler in interface ProblemDifferentiatorpublic UnknownFeatureHandler getUnknownFeatureHandler()
getUnknownFeatureHandler in interface ProblemDifferentiatorpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
public void setToDefaultFeatureDifferentiator(Domain domain,
FeatureKey key)
ProblemDifferentiator
setToDefaultFeatureDifferentiator in interface ProblemDifferentiatorpublic void setToDefaultFeatureDifferentiator(FeatureSpec spec)
ProblemDifferentiator
setToDefaultFeatureDifferentiator in interface ProblemDifferentiator
public void setOverridingFeatureDifferentiator(FeatureKey key,
FeatureDifferentiator featureDifferentiator)
ProblemDifferentiator
setOverridingFeatureDifferentiator in interface ProblemDifferentiatorpublic FeatureDifferentiator getFeatureDifferentiator(FeatureKey key)
ProblemDifferentiator
getFeatureDifferentiator in interface ProblemDifferentiator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||