[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [henshin-dev] Specifying the number of unit/rule applications with parameters
|
I am now thinking it would be more consistent if we introduced a unit
type "IteratedUnit" (to avoid confusion with CountedUnit) with a String
attribute "iterations" and one subunit. The number of iterations will be
computed when the unit is executed (as described below)
Chris
Am 14.06.2012 09:39, schrieb Christian Krause:
Hi,
I noticed that it would be a useful feature to support the
specification of the number of applications of transformation units or
rules by parameters. I think Felix also had this idea a while ago. To
be clear, I do not want to introduce CountedUnit again, but a way to
specify the number of applications using a parameter. This would be
very useful, e.g. in the comb pattern example (I can also imagine
other scenarios where this would be useful).
This could be a way of doing it: we add a String attribute
"applications" to TransformationUnit. If it is set, it will be
evaluated using the JavascriptEngine (using the specified parameter
values), which should return an integer n. Then the rule or unit is
tried to be n times. The application returns true if it could be
applied n times, false otherwise.
For example, if I want to apply a rule n^2 times, I could just add a
parameter "n" and set the applications attribute to "n*n".
cheers,
christian