A class to represent the abstraction of similarity between two CG concepts.
Takes into account types, supertypes, referents, etc.
Considers similarity to be a floating point number between 0 and 1 inclusive.
Given two concepts, prepare their similarity measurements.
public double getSimilarity()
public void setSimilarity(double similarity)
private double calculateTypeSimilarity()
Uses the hierarchy to determine similarity of two types.
The strategy is to favor shorter numbers of "hops" up and down the hierarchy.
A straightforward calculation is to say the similarity is
1 / (number of hops + 1). If two types are the same, then hops is zero and the similarity is one.
If there's one hop difference, then hops is one and the similarity is one-half, etc.