[gecode-users] rewriting a propagator

Guido Tack tack at ps.uni-sb.de
Thu Feb 14 09:29:33 CET 2008


Alejandro Arbelaez wrote:
> Right now, I'm working on a heuristic using Gecode, and I need to  
> record some information during the propagation process.
> So far things are going well, but now I'm facing a problem with re- 
> writable propagators because sometimes there is call to  
> GECODE_REWRITE which (if I understand well), removes the current  
> propagator from the space and impose another one,

Exactly.

> but in (http://www.gecode.org/gecode-doc-latest/int_2element_2view_8icc-source.html#l00537 
> ) [ViewDom<VA,VB,VC>::propagate -- line 537] there is an explicit  
> imposition of DomEq  (i.e. dispose the current propagator and  
> creates the new one.), please let me know, whether these two things  
> are the same or not.

They are essentially the same - have a look at the definition of  
GECODE_REWRITE at
http://www.gecode.org/gecode-doc-latest/macros_8icc-source.html#l00115

The reason why we explicitly create the new propagator and then  
subsume the old one here is how Rel::EqDom::post works:
http://www.gecode.org/gecode-doc-latest/int_2rel_2eq_8icc-source.html#l00142
It first checks for assignment, and then checks that the arguments are  
not the same, and only then posts the propagator.  But in the element  
case, we already know that none of the variables is assigned and  
they're not the same, so we want to avoid the checks.  And the  
GECODE_REWRITE macro cannot cope with propagators created via new, it  
requires them to be created by a post function.

I hope this clarifies things!

Cheers,
	Guido

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080214/5b27baaa/attachment.htm>


More information about the gecode-users mailing list