Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » VIATRA » Self-reference in viatra(Using Viatra to copy TTC model.)
Self-reference in viatra [message #1758263] Sun, 26 March 2017 08:17 Go to next message
zhang ph is currently offline zhang phFriend
Messages: 43
Registered: March 2017
Member
Hi,
In the past days, i tried to use viatra to copy the TTC model, but when i copy elements of Switch and Segment, it is hard to implement the self-reference 'connectsTo' with vql and xtend. Could you offer me any advice? Or could you show me an example?
The attachment is the meta-model of TTC, you can refer to is.
Hope for your reply and thanks in advance!
Re: Self-reference in viatra [message #1758343 is a reply to message #1758263] Mon, 27 March 2017 20:20 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi,

I don't really understand what are you trying to achieve here. In general, self-references can be easily extended in VQL using two variables, like `Switch.connectsTo(a,b);` or even `Switch.connectsTo(a,a);` depending on what you want to achieve. If you provide a more precise use case, I would be better equipped to suggest a use.

However, if you only want to copy the model (or a subtree of it), you could also have a look at the EcoreUtil#copy static method provided by EMF.

Best regards,
Zoltán
Re: Self-reference in viatra [message #1758731 is a reply to message #1758343] Sat, 01 April 2017 07:40 Go to previous messageGo to next message
zhang ph is currently offline zhang phFriend
Messages: 43
Registered: March 2017
Member
Hi,
Thanks for your advice and sorry for my late reply !
The purpose of mine is to check whether VIATRA can finish this task and what about the performance is, not just copy the model. and fortunately i have finished the copy task. But i found the consumed time of 1st transformation is about 25 minutes(Maybe it is unacceptable for me) and the 2nd transformation is less 1 second(It's excellent), the model element is 1,565,000 and in my test i referred to the tutorial on http://static.incquerylabs.com/projects/viatra/viatra-docs/ViatraDocs.html with the event-driven mode .
Re: Self-reference in viatra [message #1758733 is a reply to message #1758731] Sat, 01 April 2017 11:38 Go to previous message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi,

without seeing any detailed performance measurement results, I am only guessing, but I believe, the indexing required for one of the queries should be the culprit.

I'd do the following steps here:

1. Ensure the pattern editor provides no warnings, especially cartesian product warnings. The ones detected can increase initialization time and memory consumption greatly.
2. Look at our query optimization guide [1] and review your patterns.
3. Execute the query performance suite [2] and find out which query seems expensive. If the result is unclear, and you can share the problematic pattern(s), we can try to help figuring out what goes wrong.

Best regards,
Zoltán

[1] https://wiki.eclipse.org/VIATRA/Query/FAQ#Optimizing_queries_and_transformations
[2] https://wiki.eclipse.org/VIATRA/Query/UserDocumentation/SDK/QueryHotspotTesting
Previous Topic:Incquery - how to query the association relationship in UML
Next Topic:Persistence of internal state
Goto Forum:
  


Current Time: Fri Dec 06 05:51:15 GMT 2024

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

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

Back to the top