[gecode-users] Propagator called too soon...
Christian Schulte
schulte at imit.kth.se
Thu Mar 16 19:37:35 CET 2006
Guido is almost right: however, you cannot distinguish a first from a second
invocation. What you have to do is to record the domain size when the
propagator is created. Then, the propagate function simply has to check
whether the size has changed. If yes, just report failure.
Christian
--
Christian Schulte, http://web.imit.kth.se/~schulte/
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Guido Tack
Sent: Thursday, March 16, 2006 5:56 PM
To: users at gecode.org
Subject: Re: [gecode-users] Propagator called too soon...
Hi.
I had an idea this morning how to prevent the propagator from failing right
after posting it: each time it is invoked, simply test whether the domain is
still untouched. Remeber that you don't even have to check whether the
domain
is still the same, you could simply check its size!
Of course, your propagator is invoked at most twice. Once right after
creation, where you check the domain, and it is still ok, and you just
return
ES_FIX. Then, possibly, if the domain is shrunk, you test again, this time
you detect the change, and you return ES_FAILED.
Testing is cheap, and it is done at most twice, so I think I'd prefer this
simple solution over changing the subscription interface.
Cheers,
Guido
--
Guido Tack
Programming Systems Lab, Saarland University, Germany
http://www.ps.uni-sb.de/~tack
_______________________________________________
Gecode users mailing list
users at gecode.org https://www.gecode.org/mailman/listinfo/gecode-users
More information about the gecode-users
mailing list