|[EMF Compare] Visibility in StatisticBasedSimilarityChecker [message #732311]
||Tue, 04 October 2011 09:09
| Victor Roldan Betancort
Registered: July 2009
I've been facing problem with the EMF Compare engine when comparing
models with lots of very similar elements, that only differ in their
EReferences (and not in their EAttributes). This situation makes the
current StatisticBasedSimilarityChecker very prone to wrong matches.
The first option would be "then your model elements more easily
identifiable and unambiguous". That would be ideal, but not that easy
when dealing metamodels defined by third-parties.
One of the weights of
StatisticBasedSimilarityChecker.absoluteMetric(EObject, EObject) is
"ContentSimilarity". Depending on some constraints, the content
similarity will be calculated according to:
This method seems very nice in the case we have several EAttributes that
allows us to obtain a unique String as identifier. But thats not our
case (many EAttributes are just empty, not calculated, or just have a
default value). However, it may be possible to calculate such a string
from their contained EReferences.
So in there are chances for me to customize this, as I subclassed
StatisticBasedSimilarityChecker and I can redefine
However, some things that may be necessary are unavailable due to
visibility. This is the case, for example, of the similarity cache. Are
the any changes that it could become protected, as well as similarity
I can create bugzilla and sumbit patch, if it proceeds.