[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [henshin-user] How to easily increment (add 1 to) a parameter?
- From: "Zschaler, Steffen" <steffen.zschaler@xxxxxxxxx>
- Date: Mon, 30 Jul 2018 07:29:04 +0000
- Accept-language: en-GB, en-US
- Delivered-to: firstname.lastname@example.org
- Thread-index: AQHUJOWe1lNGeIE0C0uVVcBfbc/3+qSnY9LQ
- Thread-topic: [henshin-user] How to easily increment (add 1 to) a parameter?
Henshin is a graph-transformation language. As such, it is good at making changes to graphs, less good at making changes to "free-floating" values like the parameter value in your example. As a result, changing parameter values only is always going to be a cumbersome thing to do in Henshin. Are you sure you're using the right tool for the job?
Dr. rer. nat. Steffen Zschaler AHEA
King's College London
Department of Informatics
Phone +44 (020) 7848 1513
From: henshin-user-bounces@xxxxxxxxxxx [mailto:henshin-user-bounces@xxxxxxxxxxx] On Behalf Of Benjamin Heidelmeier
Sent: 26 July 2018 14:36
To: Henshin User Mailing List <henshin-user@xxxxxxxxxxx>
Subject: [henshin-user] How to easily increment (add 1 to) a parameter?
Dear Henshin Users,
in the process of creating a set of Henshin Units and Rules I stumbled upon a task, which ideally should be easy to deal with: I want to increment an integer parameter. I attached an image of the units and rules I set up to do this. It feels very bloated if you consider the only thing which should be done is incrementing a parameter.
The attached image shows the unit incrementHour which takes the IN parameter "hour" and outputs the OUT parameter "oneMore" which is
hour+1. The object Temp you can see in the rules exists for the sole
purpose to make incrementing possible. It has one attribute "tempInt"
of type EInt, which temporarily stores the parameter value that is going to be incremented.
Do you have any idea how to do this "better"? E.g. one of the following
- less rules/units,
- without an instance object,
- or whatever you consider smarter
I would be happy to hear any suggestions from you.