Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in Crossover? #12

Open
sjiherzig opened this issue Jul 20, 2017 · 4 comments
Open

Problem in Crossover? #12

sjiherzig opened this issue Jul 20, 2017 · 4 comments

Comments

@sjiherzig
Copy link
Contributor

sjiherzig commented Jul 20, 2017

Hi,

I ran into a weird problem today which, I think, is a result of re-using the crossover operators of MOEA directly. Specifically, I kept getting "XYZ is not contained in a resource" type errors on occasion at the end, when the framework was trying to save the models.

It seems that, during crossovers, references to elements in other solutions can be preserved (with a resolvable proxy to another solution). For instance, say you have simple problem with two classes A and B, where A has a reference property to 0..* Bs called "b" (containment). Your initial solution contains only an instance of A. Let's say a rule is to add a B to an A. That means, your Henshin rule would have a (preserve)A, and a (create)B, with a (create)b from A to B. When crossing over two solutions S1 and S2, the solutions are NOT marked as dirty, meaning that S1 and S2 suddenly contain cross-references (since the As in the matches are still bound to the original graph).

Weirdly, this doesn't seem to always happen. The mutation operators mark the solution as dirty, thereby forcing re-evaluation of the matches. However, I don't see the equivalent on the crossover operator. Not sure whether dirtying the entire solution would be a good idea - perhaps just part of the solution needs to be re-evaluated?

Let me know your thoughts...

Sebastian

@sjiherzig
Copy link
Contributor Author

Actually, never mind - setVariable in TransformationSolution already marks the solution as dirty... weird. For some reason there are instances where I get targets for Matches that are non-null, and refer to elements of a different solution... strange.

@martin-fleck-at
Copy link
Collaborator

I am not sure if there is an actual problem now or not? What you are describing should not be happening and sounds a bit worrysome: matches referring to elements of different solution models.

@sjiherzig
Copy link
Contributor Author

Good question - it happens sporadically on some models. E.g., in one case, weirdly, consistently if I change the multiplicity in that case from 0..* to 2..* - the solution produced seemingly ensures two elements being added, but the second element consistently refers to a different source graph in the "partial match" of the henshin match.

I wonder if this is a Henshin bug. I can try and create an example at some point, but I suspect you probably don't have much time to look into this :-)

@Leative
Copy link

Leative commented Jun 26, 2018

Just a shot in the dark, since I don't know any internals of MOMoT and your description is rather specific:
Don't reuse Henshin-UnitApplications in sequences of rule executions if you use IN parameters. I've encountered problems where already assigned parameters of a former rule execution have been reused in a later rule execution. I could imagine this may lead to strange cross-references in certain situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants