Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [MOFScript]transformation code
[MOFScript]transformation code [message #384875] Fri, 22 August 2008 04:10 Go to next message
yeliu is currently offline yeliu
Messages: 145
Registered: July 2009
Senior Member
Hello,
I have a series instances of different class.the relations of them looks
like the following:
a
|
b
/ | \
b1 b2 b3
| | |
c1 c2 c3
| | |
d1 d2 d3
\ | /
d
|
e
b contains 3 outports:b1,b2,b3.
d contains 3 inports:d1,d2,d3.
The target code that I want to generate looks like this:
connect a->b
connect b1->c1->d1
connect b2->c2->d2
connect b3->c3->d3
connect d->e
Hope I describe clearly!
How do I write this code in MORScript?
Thank you very much!


Ye
Re: [MOFScript]transformation code [message #385273 is a reply to message #384875] Thu, 28 August 2008 08:58 Go to previous message
Tor Neple is currently offline Tor Neple
Messages: 57
Registered: July 2009
Member
Hello

I wrote this answer after answering your newer post.

I guess approach to take will vary depending on what you want to
acheive, or what the rules for the output are. Do you want to calculate
all paths from a to d? Or is the rule more like:
if node only has one outconnection
print that connection
etc
What I am trying to get at is how are the rules formulated that say that
the next line to print is not b->b1 then b->b2 and b->b3?

As mentioned in the earlier post this case smells a bit of recursion (or
nested forEach loops)

Regards

Tor


Ye Liu wrote:
> Hello,
> I have a series instances of different class.the relations of them looks
> like the following:
> a
> |
> b
> / | \
> b1 b2 b3
> | | |
> c1 c2 c3
> | | |
> d1 d2 d3
> \ | /
> d
> |
> e
> b contains 3 outports:b1,b2,b3.
> d contains 3 inports:d1,d2,d3.
> The target code that I want to generate looks like this:
> connect a->b
> connect b1->c1->d1
> connect b2->c2->d2
> connect b3->c3->d3
> connect d->e
> Hope I describe clearly!
> How do I write this code in MORScript? Thank you very much!
>
>
> Ye
>
>
>
>
Re: [MOFScript]transformation code [message #620464 is a reply to message #384875] Thu, 28 August 2008 08:58 Go to previous message
Tor Neple is currently offline Tor Neple
Messages: 57
Registered: July 2009
Member
Hello

I wrote this answer after answering your newer post.

I guess approach to take will vary depending on what you want to
acheive, or what the rules for the output are. Do you want to calculate
all paths from a to d? Or is the rule more like:
if node only has one outconnection
print that connection
etc
What I am trying to get at is how are the rules formulated that say that
the next line to print is not b->b1 then b->b2 and b->b3?

As mentioned in the earlier post this case smells a bit of recursion (or
nested forEach loops)

Regards

Tor


Ye Liu wrote:
> Hello,
> I have a series instances of different class.the relations of them looks
> like the following:
> a
> |
> b
> / | \
> b1 b2 b3
> | | |
> c1 c2 c3
> | | |
> d1 d2 d3
> \ | /
> d
> |
> e
> b contains 3 outports:b1,b2,b3.
> d contains 3 inports:d1,d2,d3.
> The target code that I want to generate looks like this:
> connect a->b
> connect b1->c1->d1
> connect b2->c2->d2
> connect b3->c3->d3
> connect d->e
> Hope I describe clearly!
> How do I write this code in MORScript? Thank you very much!
>
>
> Ye
>
>
>
>
Previous Topic:[MOFScript] Error in MOFScript generating code by Java
Next Topic:[MOFScript]execute transformation
Goto Forum:
  


Current Time: Thu Aug 21 10:10:21 EDT 2014

Powered by FUDForum. Page generated in 0.02394 seconds