de.dfki.mycbr.core.similarity
Interface ISimFct

All Superinterfaces:
java.util.Observer
All Known Implementing Classes:
AdvancedDoubleFct, AdvancedFloatFct, AdvancedIntegerFct, DateFct, DoubleFct, FloatFct, IntegerFct, IntervalFct, NumberFct, OrderedSymbolFct, SpecialFct, StringFct, SymbolFct, TaxonomyFct

public interface ISimFct
extends java.util.Observer

Has to be implemented by each similarity function such that one can always compute similarity of two attributes without casting the ISimFct to a specific object.

Author:
myCBR Team

Method Summary
 Similarity calculateSimilarity(Attribute value1, Attribute value2)
          Computes the similarity of value1 and value2.
 void clone(AttributeDesc descNEW, boolean active)
          Creates a new function which is the same function as this but with a different description, namely descNEW.
 AttributeDesc getDesc()
          Returns the description of the attributes which can be compared using this function
 MultipleConfig getMultipleConfig()
           
 java.lang.String getName()
          Returns the name of this function
 Project getProject()
           
 boolean isSymmetric()
          Specifies whether this function is symmetric or asymmetric
 void setMultipleConfig(MultipleConfig mc)
           
 void setName(java.lang.String name)
          Sets the name of this function to name
 void setSymmetric(boolean symmetric)
          Specifies whether this function is symmetric or not.
 
Methods inherited from interface java.util.Observer
update
 

Method Detail

calculateSimilarity

Similarity calculateSimilarity(Attribute value1,
                               Attribute value2)
                               throws java.lang.Exception
Computes the similarity of value1 and value2. Be aware that this function does not have to be symmetric. The specified values have to be of same type and must belong to the same description, else null is returned.

Parameters:
value1 - the first value
value2 - the second value
Returns:
similarity of value1 and value2, invalid similarity if the values do not have the same type or do belong to different attribute descriptions
Throws:
java.lang.Exception

isSymmetric

boolean isSymmetric()
Specifies whether this function is symmetric or asymmetric

Returns:
true, if similarity function is symmetric, false otherwise

getName

java.lang.String getName()
Returns the name of this function

Returns:
the name of this function

setName

void setName(java.lang.String name)
Sets the name of this function to name

Parameters:
name - the new name of this function

getDesc

AttributeDesc getDesc()
Returns the description of the attributes which can be compared using this function

Returns:
the description this function belongs to

setSymmetric

void setSymmetric(boolean symmetric)
Specifies whether this function is symmetric or not. If a function sim is symmetric, sim(q,c) = sim(c,q) should hold for all queries q and cases c this function is defined on. Else the function is asymmetric.

Parameters:
symmetric - specifies whether this function is symmetric or not.

getMultipleConfig

MultipleConfig getMultipleConfig()

setMultipleConfig

void setMultipleConfig(MultipleConfig mc)

getProject

Project getProject()

clone

void clone(AttributeDesc descNEW,
           boolean active)
Creates a new function which is the same function as this but with a different description, namely descNEW. Assumption: this function fits the description of descNEW.

Parameters:
descNEW -
active -