![]() |
Context of conditional generator code |
Post Reply
|
| Author | |
jkouwer
Major Contributor
Joined: 08.Mar.2010 Points: 22 |
Post Options
Thanks(0)
Quote Reply
Topic: Context of conditional generator codePosted: 04.Jun.2010 at 11:47 |
|
Hello,
Something I could not find in the manual: What is the context of the code entered in the conditional tab and in the content tab of the symbol editor? The Object / Role / Relation the symbol belongs to or the graph that contains (is going to contain) the element? Regards, Jeroen Kouwer |
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Post Options
Thanks(0)
Quote Reply
Posted: 04.Jun.2010 at 13:10 |
|
The context of a generator is a stack; a normal top-level generator starts with a stack containing just the graph, and inside a foreach loop it will have the graph and an object. The stack in a generator in an object symbol is also the graph and the object: id will return the name of the object, and id;1 the name of the graph.
This lets you do rather cool things: not only can you navigate from the object in the graph with do loops, but you can also effectively jump back out to the graph itself with a foreach loop (so your stack is myGraph, myObject, anotherObject). Obviously this can affect the speed of display, since it changes it from O(N) to O(N2): if you're displaying a graph with 10 objects, and each iterates over all 10 other objects, one refresh now does 100 object visits rather than 10. You'll generally be fine with one or even two layers like that, but by the time you get to O(N4) even the speed of MERL can't save you
|
|
![]() |
|
Post Reply
|
|
| Tweet |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |