Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] Henshin Transformation Units

Hi Yannic,

it could be a problem in wizard (I doubt that there is something wrong in the interpreter). I actually thought you were running the transformation programmatically. Then it would be much easier to find out what s going on. If you want to try that out, you can take a look at this wiki page:


and maybe also an example:

http://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.henshin/trunk/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/bank/BankExample.java 

Hope that helps,
Christian


2013/6/5 Yannic Noller <nolleryc@xxxxxxxxx>
Please find attached a screenshot of my Henshin rules. If I try to execute the "ErrorPropagationLoopElement(component)", the preview will be available, so I think the rule is applicable. If I try to execute the ErrorPropagation(component), the preview won't be available and the message is shown like in the attached file "output.png".

Cheers,
Yannic


On 5 June 2013 13:01, Christian Krause <henshin.ck@xxxxxxxxx> wrote:
Hi Yannic,
this should not be possible. Could you show us your code and the output?

Cheers,
Christian


2013/6/5 Christian Krause <me@xxxxxxxxxxx>
Hi Yannic,
this should not be possible. Could you show us your code and the output?

Cheers,
Christian


2013/6/5 Yannic Noller <nolleryc@xxxxxxxxx>
Hi all,

I try to execute a LoopUnit which has an IndependentUnit as only element. The IndependentUnit is applicable (I can execute it manually), but the LoopUnit is not. Do you have any ideas?

Cheers,
Yannic


On 30 May 2013 10:05, Yannic Noller <nolleryc@xxxxxxxxx> wrote:
I want to apply a set of rules until no rule can be applied anymore. So I think the combination of IndependentUnit and LoopUnit will work.

Thanks a lot!
Yannic



On 30 May 2013 08:18, Christian Krause <henshin.ck@xxxxxxxxx> wrote:
You are right. What is your use case? Usually if you want to apply a set of rules in random order until no rule can be applied anymore you use an IndependentUnit and wrap it in a LoopUnit. Would that work in your case?

Cheers,
Christian


2013/5/29 Yannic Noller <nolleryc@xxxxxxxxx>
Hi Christian, 

thanks, this would be perfect. But if I don't misunderstand the code, the method executePriorityUnit() will break if one sub unit succeeds. Where's my error in reasoning?

Cheers,
Yannic


On 29 May 2013 10:52, Christian Krause <henshin.ck@xxxxxxxxx> wrote:
Hi Yannic,
a PriorityUnit applies all sub-units no matter if they succeed or not. Would that be sufficient in your case?

Cheers,
Christian


2013/5/29 Christian Krause <me@xxxxxxxxxxx>
Hi Yannic,
a PriorityUnit applies all sub-units no matter if they succeed or not. Would that be sufficient in your case?

Cheers,
Christian


2013/5/29 Yannic Noller <nolleryc@xxxxxxxxx>
Hi Christian,

one question to the IndpendentUnits. You wrote that all subunits are applied in arbitrary order, but the code will break the while loop, if one execution finishes with true:

	/*
	 * Execute an IndependentUnit.
	 */
	protected boolean executeIndependentUnit(ApplicationMonitor monitor) {
		IndependentUnit indepUnit = (IndependentUnit) unit;
		List<Unit> subUnits = new ArrayList<Unit>(indepUnit.getSubUnits());
		boolean success = false;
		while (!subUnits.isEmpty()) {
			if (monitor.isCanceled()) {
				if (monitor.isUndo()) undo(monitor);
				break;
			}
			int index = new Random().nextInt(subUnits.size());
			UnitApplicationImpl unitApp = createApplicationFor(subUnits.remove(index));
			if (unitApp.execute(monitor)) {
				updateParameterValues(unitApp);
				appliedRules.addAll(unitApp.appliedRules);
				success = true;
				break;
			}
		}
		monitor.notifyExecute(this, success);
		return success;
	}
What I need is a unit which executes all subunits independent therefrom they finish with true or false. Have you an idea or do I misunderstand the code?
Cheers,
Yannic


On 22 May 2013 14:51, Christian Krause <henshin.ck@xxxxxxxxx> wrote:
Dear Yannic,

you can take a look at this paper: http://journal.ub.tu-berlin.de/eceasst/article/view/528/530. There you can find the following:

A HENSHIN transformation unit may be of type IndependentUnit (all subunits are applied in arbitrary order), SequentialUnit (all subunits are applied sequentially in a given order), CountedUnit (its subunit is applied a given number of times), ConditionalUnit
(its subunits are applied depending on the evaluation of a given condition unit), and PriorityUnit (the applicable subunit with the highest priority is applied next). A unit is applicable (and returns true) if it can be successfully executed. PriorityUnits and IndependentUnits are always applicable, while SequentialUnits (CountedUnits) are applicable only if all subunits are applicable in the given order (the given number of times). A ConditionalUnit is applicable if either the thensubunit (in case the condition is true) or the else-subunit (in case the condition is false) are applicable.

If you want to know exactly how they work, you can take a look at the default implementation of UnitApplication: http://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.henshin/trunk/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/impl/UnitApplicationImpl.java (check out the execute* methods)

Hope that helps.

Cheers,
Christian



2013/5/22 Yannic Noller <nolleryc@xxxxxxxxx>
Dear Henshin developers,

is there any documentation about the transformation units? Especially I would like to know how exactly the PriorityUnit works.

Best Regards,
Yannic Noller

_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev





_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev




_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev




_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



Back to the top