|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.indiana.iucbrf.domain.Domain
public class Domain
An Instance of this class is a specification of a domain in which a particular CBR system will be working. Two key components of the Domain are the problem FeatureSpecCollection and solution FeatureSpecCollection, which define the FeatureSpecs for problems and solutions, respectively.
Field Summary | |
---|---|
protected double |
booleanSolutionCutoff
Applies only to single-feature solutions, where that feature is boolean. |
protected java.lang.String |
caseTitleBase
|
protected ComponentFactory |
componentFactory
|
protected DBInfo |
dbInfo
|
protected FeatureKeyFactory |
featureKeyFactory
|
protected java.lang.String |
filename
The filename to save this domain to (optional). |
protected boolean |
haveBooleanSolutionCutoff
Applies only to single-feature solutions, where that feature is boolean. |
protected boolean |
haveReferenceSolution
True if a reference solution is available, false otherwise. |
protected double |
minAcceptableQuality
The minimum "quality" (between 0 and 1 inclusive) that a solution must be judged in order to be called "successful." |
protected ProblemDifferentiator |
problemDifferentiator
Similarity weights indicate the relative importance of each problem feature in similarity comparisons. |
protected java.util.LinkedList |
problemEquivalenceClasses
The equivalence classes associated with the reference solution (if available). |
protected FeatureSpecCollection |
problemFeatureSpecCollection
The set of Feature types |
protected ProblemGenerator |
problemSpace
This ProblemGenerator generates a Problem according to the "real-life" distributions of problems. |
protected java.lang.String |
problemTitle
|
protected RDBCollectionIDFactory |
rdbCollectionIDFactory
|
protected java.lang.String |
retrievedCasesTitle
|
protected FeatureSpecCollection |
solutionFeatureSpecCollection
The Solution type |
protected java.lang.String |
solutionTitle
|
protected java.lang.String |
title
The title of this domain (optional). |
Constructor Summary | |
---|---|
Domain()
|
|
Domain(DBInfo dbInfo,
FeatureSpecRDBInfo problemSpecInfo,
FeatureSpecRDBInfo solutionSpecInfo,
RDBCollectionInfo collectionInfo)
Construct a domain that will use a database for storage, rather than structures existing in memory. |
|
Domain(DBInfo dbInfo,
FeatureSpecRDBInfo problemSpecInfo,
FeatureSpecRDBInfo solutionSpecInfo,
RDBCollectionInfo collectionInfo,
ComponentFactory componentFactory)
Construct a domain that will use a database for storage, rather than structures existing in memory. |
|
Domain(DBInfo dbInfo,
FeatureSpecRDBInfo problemSpecInfo,
FeatureSpecRDBInfo solutionSpecInfo,
RDBCollectionInfo collectionInfo,
ComponentFactory componentFactory,
FeatureKeyFactory featureKeyFactory)
Construct a domain that will use a database for storage, rather than structures existing in memory. |
|
Domain(DBInfo dbInfo,
FeatureSpecRDBInfo problemSpecInfo,
FeatureSpecRDBInfo solutionSpecInfo,
RDBCollectionInfo collectionInfo,
FeatureKeyFactory featureKeyFactory)
Construct a domain that will use a database for storage, rather than structures existing in memory. |
|
Domain(double minAcceptableQuality)
|
|
Domain(double minAcceptableQuality,
ComponentFactory componentFactory)
|
|
Domain(double minAcceptableQuality,
ComponentFactory componentFactory,
FeatureKeyFactory featureKeyFactory)
|
|
Domain(double minAcceptableQuality,
FeatureKeyFactory featureKeyFactory)
|
Method Summary | |
---|---|
FeatureKey |
addDisplayMapFeature(java.lang.String featureDescription,
java.util.HashMap valueToDisplayMap,
int collectionType,
double similarityWeight,
boolean isIndex)
A convenience method for adding a DisplayMapFeature. |
protected FeatureKey |
addFeature(FeatureSpecCollection fsc,
java.lang.String featureDescription,
java.lang.String featureTypeName)
|
protected FeatureKey |
addFeature(FeatureSpecCollection fsc,
java.lang.String featureDescription,
java.lang.String featureTypeName,
FeatureKey featureKey)
|
void |
addIndex(FeatureKey key)
|
FeatureKey |
addProblemFeature(java.lang.String featureDescription,
java.lang.String featureTypeName,
double similarityWeight,
boolean isIndex)
Add a problem feature to this domain, after the existing features. |
FeatureKey |
addProblemFeature(java.lang.String featureDescription,
java.lang.String featureTypeName,
double similarityWeight,
boolean isIndex,
FeatureKey featureKey)
Add a problem feature to this domain, after the existing features. |
void |
addSimilarityWeight(FeatureKey featureKey,
double similarityWeight)
|
FeatureKey |
addSolutionFeature(java.lang.String featureDescription,
java.lang.String featureTypeName)
|
FeatureKey |
addSolutionFeature(java.lang.String featureDescription,
java.lang.String featureTypeName,
FeatureKey featureKey)
|
FeatureKey |
addTableFeature(java.lang.String tableDescription,
FeatureKey[] rows,
int collectionType,
double similarityWeight,
boolean isIndex)
A convenience method for adding a TableFeature |
double |
calcDifference(Problem p1,
Problem p2)
Determine the difference between two problems in this domain, using this domain's similarity measure. |
void |
close()
|
SolutionQuality |
determineSolutionQuality(Problem p,
Solution s,
Solution expectedSolution)
Judge how good a solution is. |
protected boolean |
equalEquivalenceClasses(Domain otherDomain)
Determine if this domain and another have the same equivalence classes. |
boolean |
equals(java.lang.Object obj)
Determine if two domains are equal. |
protected ProblemEquivalenceClass |
findNearestEquivalenceClass(Problem p)
Determine which of this domain's equivalence classes the given problem belongs in. |
protected void |
finishProblemFeatureAddition(FeatureKey featureKey,
double similarityWeight,
boolean isIndex)
|
Problem |
generateProblem()
Generate a Problem according to "real-life" distributions specified via setProblemSpace(). |
java.lang.String |
getCaseTitleBase()
|
ComponentFactory |
getComponentFactory()
|
DBInfo |
getDBInfo()
|
java.util.LinkedList |
getEquivalenceClasses()
Get the LinkedList of reference method equivalence classes for this domain. |
java.lang.String |
getFeatureDescription(FeatureKey featureKey)
|
java.lang.String |
getFeatureDescriptionAsHTML(FeatureKey featureKey)
|
FeatureInputPanel |
getFeatureInputPanel(FeatureKey featureKey,
int collectionType,
boolean allowUnknowns)
|
FeatureInputPanel |
getFeatureInputPanel(int collectionType,
FeatureKey featureKey,
java.lang.Class featureType,
boolean allowUnknowns)
|
FeatureKeyFactory |
getFeatureKeyFactory()
|
FeatureSpecCollection |
getFeatureSpecCollection(int collectionType)
|
java.lang.String |
getFilename()
|
double |
getMinAcceptableQuality()
Get the minimum quality a solution must be to be judged "successful". |
int |
getNumberOfEquivalenceClasses()
Get the number of reference method equivalence classes for this domain. |
ProblemDifferentiator |
getProblemDifferentiator()
|
int |
getProblemFeatureCount()
Get the number of features in this domain. |
FeatureInputPanel |
getProblemFeatureInputPanel(FeatureKey featureKey,
boolean allowUnknowns)
|
FeatureSpecCollection |
getProblemFeatureSpecCollection()
Get the list of problem feature types for this domain. |
java.lang.Class |
getProblemFeatureType(FeatureKey featureKey)
Get the problem feature class of this domain at the specified index. |
java.lang.String |
getProblemTitle()
|
RDBCollectionIDFactory |
getRDBCollectionIDFactory()
|
Solution |
getReferenceSolution(Problem p)
Obtain a solution to a problem according to some reference technique. |
java.lang.String |
getRetrievedCasesTitle()
|
int |
getSolutionFeatureCount()
Get the number of features in a solution in this domain. |
FeatureInputPanel |
getSolutionFeatureInputPanel(FeatureKey featureKey,
boolean allowUnknowns)
|
FeatureSpecCollection |
getSolutionFeatureSpecCollection()
Get the list of solution feature types for this domain. |
java.lang.Class |
getSolutionFeatureType(FeatureKey featureKey)
Get the problem feature class of this domain at the specified index. |
java.lang.String |
getSolutionTitle()
|
java.lang.reflect.Constructor |
getStandardConstructor(FeatureKey featureKey,
int collectionType)
|
java.lang.String |
getTitle()
|
int |
hashCode()
Calculate a hash code based on the problem Class, the feature classes, and the solution class. |
boolean |
haveReferenceSolution()
Returns true if a reference solution has been specified for this domain, false otherwise. |
boolean |
isProblemSpaceSet()
Returns true if a problem space has been specified for this domain, or false if not. |
void |
registerExtraFeatureSpecData(FeatureKey featureKey,
java.lang.Object dataKey,
java.lang.Object data,
int collectionType)
|
void |
removeProblemFeature(FeatureKey key)
|
void |
removeSolutionFeature(FeatureKey key)
|
void |
replaceFeature(FeatureSpecCollection fsc,
FeatureSpec newSpec)
Replaces the FeatureSpec with key newSpec.getFeatureKey() with newSpec. |
void |
replaceFeature(FeatureSpecCollection fsc,
FeatureSpec newSpec,
boolean newIsIndex)
Replaces the FeatureSpec with key newSpec.getFeatureKey() with newSpec. |
void |
replaceFeature(FeatureSpecCollection fsc,
FeatureSpec newSpec,
double newSimWeight)
Replaces the FeatureSpec with key newSpec.getFeatureKey() with newSpec. |
void |
replaceFeature(FeatureSpecCollection fsc,
FeatureSpec newSpec,
double simWeight,
boolean isIndex)
Replaces the FeatureSpec with key newSpec.getFeatureKey() with newSpec. |
void |
setBooleanSolutionCutoff(double booleanSolutionCutoff)
Applies only to single-feature solutions, where that feature is boolean. |
void |
setCaseTitleBase(java.lang.String caseTitleBase)
|
void |
setDBInfo(DBInfo dbInfo)
|
void |
setEquivalenceClasses(java.util.LinkedList problemEquivalenceClasses)
Assign the equivalence classes for this domain's getReferenceSolution(). |
void |
setEquivalenceClasses(java.util.LinkedList problemEquivalenceClasses,
double booleanSolutionCutoff)
|
void |
setFeatureValueFormat(FeatureKey featureKey,
FeatureValueFormat format,
int collectionType)
|
void |
setFilename(java.lang.String filename)
The name of the file for saving this domain. |
void |
setMinAcceptableQuality(double minAcceptableQuality)
|
void |
setProblemDifferentiator(ProblemDifferentiator problemDifferentiator)
|
void |
setProblemSpace(ProblemGenerator pg)
Define the problem space for this domain. |
void |
setProblemTitle(java.lang.String problemTitle)
|
void |
setRetrievedCasesTitle(java.lang.String retrievedCasesTitle)
|
void |
setSolutionTitle(java.lang.String solutionTitle)
|
void |
setStandardConstructor(FeatureKey featureKey,
int collectionType,
java.lang.String[] argTypes)
|
void |
setTitle(java.lang.String title)
Set the title of this domain. |
protected void |
standardInit(DBInfo dbInfo,
RDBCollectionInfo collectionInfo,
double minAcceptableQuality,
double[] givenSimilarityWts,
java.util.HashSet indexKeys)
|
protected void |
standardInit(double minAcceptableQuality,
double[] givenSimilarityWts,
java.util.HashSet indexKeys)
|
java.lang.String |
toString()
Get a String representation of this domain. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected FeatureSpecCollection problemFeatureSpecCollection
protected FeatureSpecCollection solutionFeatureSpecCollection
protected java.util.LinkedList problemEquivalenceClasses
protected double minAcceptableQuality
protected boolean haveReferenceSolution
protected ProblemDifferentiator problemDifferentiator
protected ComponentFactory componentFactory
protected FeatureKeyFactory featureKeyFactory
protected RDBCollectionIDFactory rdbCollectionIDFactory
protected java.lang.String title
protected java.lang.String problemTitle
protected java.lang.String solutionTitle
protected java.lang.String retrievedCasesTitle
protected java.lang.String caseTitleBase
protected java.lang.String filename
protected ProblemGenerator problemSpace
protected DBInfo dbInfo
protected double booleanSolutionCutoff
protected boolean haveBooleanSolutionCutoff
Constructor Detail |
---|
public Domain()
public Domain(double minAcceptableQuality)
public Domain(double minAcceptableQuality, FeatureKeyFactory featureKeyFactory)
public Domain(double minAcceptableQuality, ComponentFactory componentFactory)
public Domain(double minAcceptableQuality, ComponentFactory componentFactory, FeatureKeyFactory featureKeyFactory)
public Domain(DBInfo dbInfo, FeatureSpecRDBInfo problemSpecInfo, FeatureSpecRDBInfo solutionSpecInfo, RDBCollectionInfo collectionInfo)
public Domain(DBInfo dbInfo, FeatureSpecRDBInfo problemSpecInfo, FeatureSpecRDBInfo solutionSpecInfo, RDBCollectionInfo collectionInfo, ComponentFactory componentFactory)
public Domain(DBInfo dbInfo, FeatureSpecRDBInfo problemSpecInfo, FeatureSpecRDBInfo solutionSpecInfo, RDBCollectionInfo collectionInfo, FeatureKeyFactory featureKeyFactory)
public Domain(DBInfo dbInfo, FeatureSpecRDBInfo problemSpecInfo, FeatureSpecRDBInfo solutionSpecInfo, RDBCollectionInfo collectionInfo, ComponentFactory componentFactory, FeatureKeyFactory featureKeyFactory)
Method Detail |
---|
protected void standardInit(double minAcceptableQuality, double[] givenSimilarityWts, java.util.HashSet indexKeys)
protected void standardInit(DBInfo dbInfo, RDBCollectionInfo collectionInfo, double minAcceptableQuality, double[] givenSimilarityWts, java.util.HashSet indexKeys)
public void close()
public ComponentFactory getComponentFactory()
public void setProblemDifferentiator(ProblemDifferentiator problemDifferentiator)
public ProblemDifferentiator getProblemDifferentiator()
public void setDBInfo(DBInfo dbInfo)
public DBInfo getDBInfo()
public void removeProblemFeature(FeatureKey key)
public void replaceFeature(FeatureSpecCollection fsc, FeatureSpec newSpec)
public void replaceFeature(FeatureSpecCollection fsc, FeatureSpec newSpec, double newSimWeight)
public void replaceFeature(FeatureSpecCollection fsc, FeatureSpec newSpec, boolean newIsIndex)
public void replaceFeature(FeatureSpecCollection fsc, FeatureSpec newSpec, double simWeight, boolean isIndex)
public void removeSolutionFeature(FeatureKey key)
public void registerExtraFeatureSpecData(FeatureKey featureKey, java.lang.Object dataKey, java.lang.Object data, int collectionType)
public FeatureKey addDisplayMapFeature(java.lang.String featureDescription, java.util.HashMap valueToDisplayMap, int collectionType, double similarityWeight, boolean isIndex)
public FeatureKey addTableFeature(java.lang.String tableDescription, FeatureKey[] rows, int collectionType, double similarityWeight, boolean isIndex)
public FeatureKey addProblemFeature(java.lang.String featureDescription, java.lang.String featureTypeName, double similarityWeight, boolean isIndex)
public FeatureKey addProblemFeature(java.lang.String featureDescription, java.lang.String featureTypeName, double similarityWeight, boolean isIndex, FeatureKey featureKey)
featureValueFormat
- may be null if no special formatting is required
protected void finishProblemFeatureAddition(FeatureKey featureKey, double similarityWeight, boolean isIndex)
protected FeatureKey addFeature(FeatureSpecCollection fsc, java.lang.String featureDescription, java.lang.String featureTypeName)
protected FeatureKey addFeature(FeatureSpecCollection fsc, java.lang.String featureDescription, java.lang.String featureTypeName, FeatureKey featureKey)
public FeatureKey addSolutionFeature(java.lang.String featureDescription, java.lang.String featureTypeName, FeatureKey featureKey)
public FeatureKey addSolutionFeature(java.lang.String featureDescription, java.lang.String featureTypeName)
public void setFeatureValueFormat(FeatureKey featureKey, FeatureValueFormat format, int collectionType)
public void setTitle(java.lang.String title)
public java.lang.String getTitle()
public void setSolutionTitle(java.lang.String solutionTitle)
public java.lang.String getSolutionTitle()
public void setProblemTitle(java.lang.String problemTitle)
public java.lang.String getProblemTitle()
public void setRetrievedCasesTitle(java.lang.String retrievedCasesTitle)
public java.lang.String getRetrievedCasesTitle()
public void setCaseTitleBase(java.lang.String caseTitleBase)
public java.lang.String getCaseTitleBase()
public FeatureKeyFactory getFeatureKeyFactory()
public RDBCollectionIDFactory getRDBCollectionIDFactory()
public void setFilename(java.lang.String filename)
public java.lang.String getFilename()
public boolean isProblemSpaceSet()
public void setProblemSpace(ProblemGenerator pg)
public Problem generateProblem() throws ProblemSpaceNotSpecifiedException
ProblemSpaceNotSpecifiedException
public FeatureInputPanel getProblemFeatureInputPanel(FeatureKey featureKey, boolean allowUnknowns)
public FeatureInputPanel getSolutionFeatureInputPanel(FeatureKey featureKey, boolean allowUnknowns)
public FeatureInputPanel getFeatureInputPanel(FeatureKey featureKey, int collectionType, boolean allowUnknowns)
public FeatureInputPanel getFeatureInputPanel(int collectionType, FeatureKey featureKey, java.lang.Class featureType, boolean allowUnknowns)
public java.lang.Class getProblemFeatureType(FeatureKey featureKey)
public FeatureSpecCollection getProblemFeatureSpecCollection()
public java.lang.Class getSolutionFeatureType(FeatureKey featureKey)
public FeatureSpecCollection getSolutionFeatureSpecCollection()
public FeatureSpecCollection getFeatureSpecCollection(int collectionType)
public int getProblemFeatureCount()
public int getSolutionFeatureCount()
public void setBooleanSolutionCutoff(double booleanSolutionCutoff)
public java.util.LinkedList getEquivalenceClasses()
public int getNumberOfEquivalenceClasses()
public double getMinAcceptableQuality()
public void setMinAcceptableQuality(double minAcceptableQuality)
public boolean haveReferenceSolution()
public void setStandardConstructor(FeatureKey featureKey, int collectionType, java.lang.String[] argTypes)
public java.lang.reflect.Constructor getStandardConstructor(FeatureKey featureKey, int collectionType)
public Solution getReferenceSolution(Problem p) throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
protected boolean equalEquivalenceClasses(Domain otherDomain)
public SolutionQuality determineSolutionQuality(Problem p, Solution s, Solution expectedSolution)
public void setEquivalenceClasses(java.util.LinkedList problemEquivalenceClasses)
public void setEquivalenceClasses(java.util.LinkedList problemEquivalenceClasses, double booleanSolutionCutoff)
protected ProblemEquivalenceClass findNearestEquivalenceClass(Problem p)
public double calcDifference(Problem p1, Problem p2)
public java.lang.String getFeatureDescription(FeatureKey featureKey)
public java.lang.String getFeatureDescriptionAsHTML(FeatureKey featureKey)
public java.lang.String toString()
toString
in class java.lang.Object
public void addSimilarityWeight(FeatureKey featureKey, double similarityWeight)
public void addIndex(FeatureKey key)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |