Crossover operation by EMF Compare [message #1834507] |
Wed, 11 November 2020 15:10 |
Meysam Karimi Messages: 2 Registered: November 2020 |
Junior Member |
|
|
Hi Folks,
I am trying to use EMF compare for crossover operation between two models. For whom may not familiar with crossover operation in GA, Crossover_(genetic_algorithm) page in Wikipedia can be useful.
To summarize the question, there are two model parents and we are going to have a single child from these two parents using Single-point crossover. Assume each model has 20 elements, the child is going to inherit first 10 elements from the first parent and the remaining elements from the second parent.
I see this is possible to use EMF Compare for comparison and merging the models. Is it possible to use EMF Compare to crossover? If so, would you give me some pseudo code or algorithm to do so?
Special thanks to you all.
[Updated on: Thu, 12 November 2020 04:15] Report message to a moderator
|
|
|
Re: Crossover operation by EMF Compare [message #1834691 is a reply to message #1834507] |
Mon, 16 November 2020 08:22 |
|
Hello,
I am not sure exactly what crossover is, but if I don't think what you're trying to achieve fits a comparison engine. EMF Compare will detect differences between your two models, while what you're trying to achieve seems to be a merge that does not rely on diffs (take first 10 children from left, take 10 other children from right and create a composite model). I guess you might be able to reach that behavior by detecting all first 10 as "added in the left" and "removed from right" then merge everything toward the right so that EMF Compare will first delete these 10 elements then re-add them exactly as they are in the left model... but I'm not sure this is what you want.
Please elaborate if you think EMF Compare might fit the requirement, I might be able to point you in the right direction but for now I'm not really sure what you plan on doing and what your input models are.
Regards,
Laurent Goubet
Obeo
|
|
|
|
Re: Crossover operation by EMF Compare [message #1834990 is a reply to message #1834706] |
Mon, 23 November 2020 08:25 |
|
Hello,
1 - You will have to look at how the DiffEngine is implemented I believe your entry point here would be org.eclipse.emf.compare.diff.DefaultDiffEngine.computeContainmentDifferences(Match, EReference, boolean) ) and implement your own arbitrary rule as to which elements from either side needs to be detected as an addition so that the merge will take them later. Note that if the elements you want to be "distinct" and thus "added" are currently matched by EMF Compare, you will also have to customize the MatchEngine in order to prevent these objects to be matched together.
2 - As long as these children EObjects are within a given container in either side, it means that it conforms to the metamodel and thus the result of a merge should still be conformant, what kind of rule would be violated by merging?
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.06995 seconds