Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-user] Connect all possible A and B only once

Thanks for all your answers.

I think NACs will do it ;-)


Best,
Jürgen


Dipl.-Ing. Jürgen Freund
Arbeitsgruppe Ähnlichkeitsmechanik

Telefon: +49 (0)711 685 69530
E-Mail:  freund@xxxxxxxxxxxxxxxxxxxx

Postadresse:
Universität Stuttgart
Institut für Statik und Dynamik der Luft- und Raumfahrtkonstruktionen
Pfaffenwaldring 27 - Zimmer 01.002
70569 Stuttgart
On 23.05.2017 13:30, Daniel Strüber wrote:
Hi all,

I agree with Steffen. When you connect two nodes, the requirement "I only want them to connect only once" implies that you need to check if any of the considered nodes already has a connection - this is essentially a negative application condition.

For a simple example NAC, see the banking example at https://www.eclipse.org/henshin/examples.php?example=bank - the "createAccount" rule has a NAC (the <<forbid>> part), specifying that an account with a certain ID can only be created if no other account with the same ID exists.

Best regards,
Daniel



Am 23.05.2017 um 12:38 schrieb Steffen Zschaler:

I see. Not sure NACs are the only way, but they seem like a natural choice. Otherwise, the risk is that Henshin will choose the same match every time and just add the same connection repeatedly.

Steffen


On 23/05/2017 11:36, Juergen Freund wrote:
Thanks for the fast answer.

I don't want to connect them directly because I am just playing around a bit and want to fully understand how Henshin works.

I also thought about NACs, but I was not sure if that is the only way to do it.


Dipl.-Ing. Jürgen Freund
Arbeitsgruppe Ähnlichkeitsmechanik

Telefon: +49 (0)711 685 69530
E-Mail:  freund@xxxxxxxxxxxxxxxxxxxx

Postadresse:
Universität Stuttgart
Institut für Statik und Dynamik der Luft- und Raumfahrtkonstruktionen
Pfaffenwaldring 27 - Zimmer 01.002
70569 Stuttgart
On 23.05.2017 12:32, Steffen Zschaler wrote:

Just some thoughts off the top of my head:

  • Why not add the connection when you create the instances of A and B?
  • Alternatively, you could probably add a NAC to your connection-creating rule to make sure the connection doesn't already exist.

Best regards,

Steffen


On 23/05/2017 11:24, Juergen Freund wrote:
Dear Henshin Users and Developers,


I have problem with rules which I am not able to solve.

I want to create 50 instances of a class A and 50 instances of a class B.

After that is done I want to connect all of them in a separate rule. And I only want them to connect only once.
Which means in the end there should be 50 edges more in the graph.

So what I have done:

  • Rule to create class A and class B
  • Iterated Unit which calls the rule above 50 times.

Now is the part I don't know haw to do it right.

  • Rule which creates an edge between a preserved A and a preserved B --> only one single connection is added
  • Amalgamation Rule which creates an edge between a preserved* A and a preserved* B --> each a has 50 connections to each B

I added the project with my examples. It would be nice if you could me out.


Kind regards,

Jürgen


-- 
Dipl.-Ing. Jürgen Freund
Arbeitsgruppe Ähnlichkeitsmechanik

Telefon: +49 (0)711 685 69530
E-Mail:  freund@xxxxxxxxxxxxxxxxxxxx

Postadresse:
Universität Stuttgart
Institut für Statik und Dynamik der Luft- und Raumfahrtkonstruktionen
Pfaffenwaldring 27 - Zimmer 01.002
70569 Stuttgart


_______________________________________________
henshin-user mailing list
henshin-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://emea01.safelinks.protection.outlook.com/?url="">

-- 
Dr. rer. nat. Steffen Zschaler AHEA
Senior Lecturer

King's College London
Department of Informatics

Email szschaler@xxxxxxx
Phone +44 (020) 7848 1513
WWW   http://www.steffen-zschaler.de/


_______________________________________________
henshin-user mailing list
henshin-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-user



_______________________________________________
henshin-user mailing list
henshin-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://emea01.safelinks.protection.outlook.com/?url="">

-- 
Dr. rer. nat. Steffen Zschaler AHEA
Senior Lecturer

King's College London
Department of Informatics

Email szschaler@xxxxxxx
Phone +44 (020) 7848 1513
WWW   http://www.steffen-zschaler.de/


_______________________________________________
henshin-user mailing list
henshin-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-user



_______________________________________________
henshin-user mailing list
henshin-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-user


Back to the top