Class SimilarityValuatorImpl
java.lang.Object
de.uni_trier.wi2.procake.similarity.impl.SimilarityValuatorImpl
- All Implemented Interfaces:
SimilarityValuator
Implementation of
SimilarityValuator
for computing the similarity between two objects.- Author:
- Rainer Maximini, Christian Zeyen
-
Field Summary
Fields inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityValuator
DEFAULT_COMPUTATION_TIME_THRESHOLD_FOR_CACHING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncomputeSimilarity
(DataObject queryObject, DataObject caseObject) Computes the similarity between a query and a case.computeSimilarity
(DataObject queryObject, DataObject caseObject, DataClass commonClass) Computes the similarity between a query and a case for the given common data class.computeSimilarity
(DataObject queryObject, DataObject caseObject, String similarityMeasureStr) Computes the similarity between a queryObject and a caseObject based on the similarityMeasurelong
getSimilarityMeasure
(DataObject query, DataObject object) Returns the appropriate similarity measure for the common parent class of both given data objects.TheSimilarityModel
that is used for the computation.void
setComputationTimeThresholdForCaching
(long timeNanos) void
setSimilarityCache
(SimilarityCache similarityCache)
-
Constructor Details
-
SimilarityValuatorImpl
-
-
Method Details
-
getSimilarityCache
- Specified by:
getSimilarityCache
in interfaceSimilarityValuator
- Returns:
- similarity cache used by this valuator or null
-
setSimilarityCache
- Specified by:
setSimilarityCache
in interfaceSimilarityValuator
- Parameters:
similarityCache
- similarity cache to be used by this valuator
-
getComputationTimeThresholdForCaching
public long getComputationTimeThresholdForCaching()- Specified by:
getComputationTimeThresholdForCaching
in interfaceSimilarityValuator
- Returns:
- computation time in nanoseconds to cache computed similarity values
-
setComputationTimeThresholdForCaching
public void setComputationTimeThresholdForCaching(long timeNanos) - Specified by:
setComputationTimeThresholdForCaching
in interfaceSimilarityValuator
- Parameters:
timeNanos
- computation time in nanoseconds to cache computed similarity values
-
getSimilarityMeasure
Description copied from interface:SimilarityValuator
Returns the appropriate similarity measure for the common parent class of both given data objects.- Specified by:
getSimilarityMeasure
in interfaceSimilarityValuator
- Parameters:
query
- the query objectobject
- the case object- Returns:
- the similarity measure for the common data class
-
computeSimilarity
Description copied from interface:SimilarityValuator
Computes the similarity between a query and a case.- Specified by:
computeSimilarity
in interfaceSimilarityValuator
- Parameters:
queryObject
- The queryDataObject
.caseObject
- The caseDataObject
.- Returns:
- the similarity value, if no applicable similarity measure exists, an invalid Similarity will be returned.
-
computeSimilarity
public Similarity computeSimilarity(DataObject queryObject, DataObject caseObject, DataClass commonClass) Description copied from interface:SimilarityValuator
Computes the similarity between a query and a case for the given common data class.- Specified by:
computeSimilarity
in interfaceSimilarityValuator
- Parameters:
queryObject
- The queryDataObject
.caseObject
- The caseDataObject
.commonClass
- The common parentDataClass
that should be used.- Returns:
- the similarity value, if no applicable similarity measure exists, an invalid Similarity will be returned.
-
computeSimilarity
public Similarity computeSimilarity(DataObject queryObject, DataObject caseObject, String similarityMeasureStr) Description copied from interface:SimilarityValuator
Computes the similarity between a queryObject and a caseObject based on the similarityMeasure- Specified by:
computeSimilarity
in interfaceSimilarityValuator
- Parameters:
queryObject
- The queryDataObject
.caseObject
- The caseDataObject
.similarityMeasureStr
- ifnull
,SimilarityValuator.computeSimilarity(DataObject, DataObject)
is used, else the similarity with the given name is used.- Returns:
- the similarity value, if no similarity measure with that name exists, an invalid Similarity will be returned.
-
getSimilarityModel
Description copied from interface:SimilarityValuator
TheSimilarityModel
that is used for the computation.- Specified by:
getSimilarityModel
in interfaceSimilarityValuator
- Returns:
- the used
SimilarityModel
-