[Lemon-user] Executing one algorithm multiple times

Alpár Jüttner alpar at cs.elte.hu
Sun Mar 14 13:38:43 CET 2010


On Sun, 2010-03-14 at 12:32 +0100, Ben Strasser wrote:
> Hi,
> 
> Alpár Jüttner wrote:
> > I think both Version 1 and 2 should be correct, while Version 3 is not.
> > Version 2 shouldn't crash, it is a probably a bug (could you submit a
> > bug report at http://lemon.cs.elte.hu/trac/lemon/wiki/IssueTracker ?).
> >   
> Are you sure that version 2 is incorrect?

If you mean it should work, then yes, it should. Otherwise it `run()`
wouldn't mean much, for the whole algorithm could be runNev in the
constructor.

>  I don't want to create a 
> minimal example that crashes just to find out, that that is the expected 
> behavior.

Don't bother creating such an example if it isn't trivial. Let's wait
for Balazs's answer, for he wrote this part of the code, so he may
immediately see the solution.

> I "solved" my problem by using version 1.
>  However that defeats the 
> purpose of having init and start at all so that doesn't seem to be the 
> "right" way.

Not really. As I wrote you, the primary purpose of the init()/start()
separation is not to allows more efficient multiple execution but
instead to provide finer execution control.

> I'd love to see some guidelines on how algorithms objects 
> should behave in the documentation.

You are very right. The documentation is clearly weak at this point.
Thanks for pointing it out. Someone will certainly fix it sooner or
later. The issue tracker is again a good place to keep record of this
kind of deficiencies, as well.

Regards,
Alpar Juttner




More information about the Lemon-user mailing list