Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Transitive Closure constraint in EVL(Writing constraints for a GMF editor in order to ensure directed acyclic relations in the model)
Transitive Closure constraint in EVL [message #1823502] Fri, 27 March 2020 17:05 Go to next message
Thomas Chiang is currently offline Thomas ChiangFriend
Messages: 100
Registered: March 2020
Senior Member
Hello!

I am currently trying to develop some constraints for my model so that all nodes are connected in a directed acyclic relationship. I have developed some code in order to do it for a single path, but my model is designed to allow branching and this is the problem; I don't know how to iterate through all the available paths when branching is enabled.

I have been browsing the forums and found some stuff about the transitive closure and TrasitiveCloserHelper but I don't understand where I'm supposed to implement it or how for that matter.

This is the current operation I use to check a single path to ensure DAG relationships. Flow are my reference classes while target is the starting node that I compare all the other nodes to when checking for cycles:

operation pathIsValidOutput_V2(flow, target){
	flow.name.println();
	if(flow.type.instanceClassName == "WFP.OutputArrow"){
		if(flow.process.inputArrow.isEmpty()){
			"Process is beginning of WF+".println();
		}
		else{
			if(flow.process.inputArrow.size>1) flow.process.inputArrow.second().println();
			for(f in flow.process.inputArrow){
				"Recursive argument".println();
				return pathIsValidOutput_V2(f,target);
			}
		}
	}
	else if(flow.type.instanceClassName == "WFP.InputArrow"){
		for(f in flow.data.outputArrow){
			"Check if output data: ".print();
			f.data.println();
			"Matches with: ".print();
			target.println();
			if(f.data==target){
				"There is a match".println();
				return false;
			}
			else{
				"Recursive argument".println();
				return pathIsValidOutput_V2(f,target);
			}
		}
	}
	return true;
}
Re: Transitive Closure constraint in EVL [message #1823724 is a reply to message #1823502] Tue, 31 March 2020 18:20 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Thomas,

Could you please put together a minimal example [1] (including a minimal metamodel and a sample model) to help us understand what you're trying to achieve and what you've tried so far?

Thanks,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: Transitive Closure constraint in EVL [message #1823775 is a reply to message #1823724] Wed, 01 April 2020 22:20 Go to previous message
Thomas Chiang is currently offline Thomas ChiangFriend
Messages: 100
Registered: March 2020
Senior Member
Hi Dimitris

I've found out that I don't actually need this anymore as for my purposes I just had to check to make sure that all my nodes were connected by one input.
Previous Topic:Duplicate connections being drawn in GMF editor generated by Eugenia
Next Topic:EOL query error
Goto Forum:
  


Current Time: Thu Apr 25 01:18:08 GMT 2024

Powered by FUDForum. Page generated in 0.03730 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top