[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [henshin-dev] InterpreterUtil.areIsomorphic(graph1, graph2) not working
|
Dear Christian,
Thank you very much for your reply.
EcoreUtil.equals(..,..) also returns false for my models, although I compare a model file with it's own copy, so they are actually the same models. (Attached you can find an example model)
Here is the code that I use for loading and comparing the resources: (you can find some more explanations below)
protected boolean matchProtocols(FSMProtocol requestedModel, FSMProtocol providedModel) {
ResourceSet resourceSet = new ResourceSetImpl();
//requested resource
String tempRqstFilePath = requestedModel.eResource().getURI().trimSegments(1).toString() + "/tempRequested";
Resource requestedResource = resourceSet.createResource(URI.createPlatformResourceURI(tempRqstFilePath, true));
requestedResource.getContents().add(requestedModel);
//provided resource
String tempPrvdFilePath = providedModel.eResource().getURI().trimSegments(1).toString() + "/tempProvided";
Resource providedResource = resourceSet.createResource(URI.createPlatformResourceURI(tempPrvdFilePath, true));
providedResource.getContents().add(providedModel);
EGraph rqstGraph = new EGraphImpl(requestedResource);
EGraph prvdGraph = new EGraphImpl(providedResource);
boolean matchingResult = InterpreterUtil.areIsomorphic(rqstGraph, prvdGraph);
return matchingResult;
}
- Our models represent simple Finite State Machines.
- FSMProtocol is the type of our models.
- For creating a ResourceSet, here I have used the normal EMF mechanism, but I also have tried it with HenshinResourceSet, and the specific Resource Factory of our mode.
- For comparing the models, I have tried the followings:
- Creating EGraph, using the Reources (as above), and comparing the graphs,
- Also, comparing the resources directly, without creating a graph.
- Till now, the method InterpreterUtil.areIsomorphic(..., ...) have returned true, only in the case that I add empty models to the graphs. >>> EGraph graph = new EGraphImpl(); graph.add(emptyModel); <<<<
Thank you very much in advance for any help.
Best regards,
Faezeh
Attachment:
universityManagement.sse_proto
Description: Binary data