nrc.fuzzy
Class SimilarityByAreaOperator

java.lang.Object
  |
  +--nrc.fuzzy.SimilarityOperator
        |
        +--nrc.fuzzy.SimilarityByAreaOperator
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, SimilarityOperatorInterface

public class SimilarityByAreaOperator
extends SimilarityOperator
implements java.io.Serializable

A class that provides an operator to calculate the similarity between 2 fuzzy values. The similarity measure is the ratio of area of intersection to area of union of the fuzzy values.

The default similarity operator is the SimilarityByPossibilityOperator. This can be changed using the static setDefaultSimilarityOperator method of the FuzzyValue class.

See Also:
SimilarityOperator, SimilarityOperatorInterface, SimilarityByPossibilityOperator, Serialized Form

Constructor Summary
SimilarityByAreaOperator()
           
 
Method Summary
 double similarity(nrc.fuzzy.FuzzyValue fv1, nrc.fuzzy.FuzzyValue fv2)
          SimilarityByAreaOperator provides a similarity method that accepts 2 FuzzyValue objects and returns the measure of the similarity between them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimilarityByAreaOperator

public SimilarityByAreaOperator()
Method Detail

similarity

public double similarity(nrc.fuzzy.FuzzyValue fv1,
                         nrc.fuzzy.FuzzyValue fv2)
                  throws IncompatibleFuzzyValuesException
SimilarityByAreaOperator provides a similarity method that accepts 2 FuzzyValue objects and returns the measure of the similarity between them.

Specified by:
similarity in interface SimilarityOperatorInterface
Parameters:
fv1 -
fv2 -
Returns:
double that is the result of applying the operator to the 2 values (the similarity measure)
IncompatibleFuzzyValuesException