jcolibri.method.retrieve.NNretrieval.similarity
Class StandardGlobalSimilarityFunction

java.lang.Object
  extended by jcolibri.method.retrieve.NNretrieval.similarity.StandardGlobalSimilarityFunction
All Implemented Interfaces:
GlobalSimilarityFunction
Direct Known Subclasses:
Average

public abstract class StandardGlobalSimilarityFunction
extends java.lang.Object
implements GlobalSimilarityFunction

Utility class to compute global similarities. The implemented compute(...) method computes the similarity of the sub-attributes of this compound attribute and then calls the computeSimilarity() abstract method to obtain the similarity value.
That way, the computeSimilarity() method is a hook to easly compute global similarities.

Version:
1.0
Author:
Juan A. Recio-Garcia

Constructor Summary
StandardGlobalSimilarityFunction()
           
 
Method Summary
 double compute(CaseComponent componentOfCase, CaseComponent componentOfQuery, CBRCase _case, CBRQuery _query, NNConfig numSimConfig)
          Computes the similarities of the sub-attributes of this CaseComponent and calls the computeSimilarity() method with those values.
abstract  double computeSimilarity(double[] values, double[] weigths, int numberOfvalues)
          Hook method that must be implemented by subclasses returned the global similarity value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardGlobalSimilarityFunction

public StandardGlobalSimilarityFunction()
Method Detail

compute

public double compute(CaseComponent componentOfCase,
                      CaseComponent componentOfQuery,
                      CBRCase _case,
                      CBRQuery _query,
                      NNConfig numSimConfig)
Computes the similarities of the sub-attributes of this CaseComponent and calls the computeSimilarity() method with those values.

Specified by:
compute in interface GlobalSimilarityFunction
Parameters:
componentOfCase - compound attribute of the case
componentOfQuery - compound attribute of the query
_case - case being compared
_query - query being compared
numSimConfig - Similarity functions configuration
Returns:
a value between [0..1]
See Also:
GlobalSimilarityFunction.compute(jcolibri.cbrcore.CaseComponent, jcolibri.cbrcore.CaseComponent, jcolibri.cbrcore.CBRCase, jcolibri.cbrcore.CBRQuery, jcolibri.method.retrieve.NNretrieval.NNConfig)

computeSimilarity

public abstract double computeSimilarity(double[] values,
                                         double[] weigths,
                                         int numberOfvalues)
Hook method that must be implemented by subclasses returned the global similarity value.

Parameters:
values - of the similarity of the sub-attributes
weigths - of the sub-attributes
numberOfvalues - (or sub-attributes) that were obtained (some subattributes may not compute for the similarity).
Returns:
a value between [0..1]

GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es