MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Context of conditional generator code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Context of conditional generator code

 Post Reply Post Reply
Author
Message
jkouwer View Drop Down
Major Contributor
Major Contributor


Joined: 08.Mar.2010
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote jkouwer Quote  Post ReplyReply Direct Link To This Post Topic: Context of conditional generator code
    Posted: 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
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 643
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post 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 Smile
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.032 seconds.