Crossover operation by EMF Compare [message #1834507] |
Wed, 11 November 2020 10:10  |
Eclipse User |
|
|
|
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: Wed, 11 November 2020 23:15] by Moderator
|
|
|
|
|
Re: Crossover operation by EMF Compare [message #1834990 is a reply to message #1834706] |
Mon, 23 November 2020 03:25  |
Eclipse User |
|
|
|
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.06513 seconds