jcolibri.method.retrieve.NNretrieval.similarity.local.recommenders
Class InrecaLessIsBetter

java.lang.Object
  extended by jcolibri.method.retrieve.NNretrieval.similarity.local.recommenders.InrecaLessIsBetter
All Implemented Interfaces:
LocalSimilarityFunction

public class InrecaLessIsBetter
extends java.lang.Object
implements LocalSimilarityFunction

This function returns the similarity of two numbers (or enums) following the INRECA - Less is Better formulae sim(c.a,q.a)= if(c.a < q.a) then 1 else jump * (max(a) - c.a) / (max(a) - q.a) jump and max(a) must be defined by the designer.


Constructor Summary
InrecaLessIsBetter(double maxAttributeValue, double jumpSimilarity)
          Constructor. max value is ignored for enum types.
 
Method Summary
 double compute(java.lang.Object caseObject, java.lang.Object queryObject)
          Applies the similarity function.
 boolean isApplicable(java.lang.Object o1, java.lang.Object o2)
          Applicable to any Number subinstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InrecaLessIsBetter

public InrecaLessIsBetter(double maxAttributeValue,
                          double jumpSimilarity)
Constructor. max value is ignored for enum types.

Method Detail

compute

public double compute(java.lang.Object caseObject,
                      java.lang.Object queryObject)
               throws NoApplicableSimilarityFunctionException
Applies the similarity function.

Specified by:
compute in interface LocalSimilarityFunction
Parameters:
caseObject - is a Number
queryObject - is a Number
Returns:
result of apply the similarity function.
Throws:
NoApplicableSimilarityFunctionException

isApplicable

public boolean isApplicable(java.lang.Object o1,
                            java.lang.Object o2)
Applicable to any Number subinstance

Specified by:
isApplicable in interface LocalSimilarityFunction

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