[gecode-users] Remapping of BoolVar propagation conditions

Guido Tack tack at ps.uni-sb.de
Sun Nov 29 14:44:34 CET 2009


Hi Vincent,

for BoolVars, there are only two possible events, "assigned 0" and "assigned 1", so I assume you wanted to add those so that your propagator is only scheduled for particular assignments, not for the general PC_BOOL_VAL.
The reason why we don't support these events is that we require propagators to report when they are subsumed at the latest when all their variables are assigned.  If a propagator only subscribed to the hypothetical PC_BOOL_ONE, but the variable was assigned 0, the propagator would not be able to report subsumption, and would remain in the system although it could be removed.
Note that this is an optimization, so if you want to change the behavior, the system would still work as expected, it would just need more memory in certain situations.  You should however check first if the additional calls of the propagators are really a performance problem.

Cheers,
	Guido

Vincent Barichard wrote:

> Hi,
> 
> I would like to add a propagation condition to the BoolVar variables. I succeeded
> to add this new propagation condition but when I tried to subscribe variables to
> this new propagation condition, I discovered that all propagation conditions
> for BoolVar are remapped to PC_BOOL_VAL.
> 
> Why are they remapped ? Can I safely removed this mapping ?
> 
> I found the remapping of the propagation condition in the file gecode/int/var-imp/bool.hpp.
> 
>  forceinline void
>  BoolVarImp::subscribe(Space& home, Propagator& p, PropCond,
>                        bool process) {
>    // Subscription can be used with integer propagation conditions,
>    // which must be remapped to the single Boolean propagation condition.
>    BoolVarImpBase::subscribe(home,p,PC_BOOL_VAL,assigned(),process);
>  }
>  forceinline void
>  BoolVarImp::cancel(Space& home, Propagator& p, PropCond) {
>    BoolVarImpBase::cancel(home,p,PC_BOOL_VAL,assigned());
>  }
> 
> Thank you for your help.
> 
> Cheers,
> Vincent
> 
> Vincent Barichard         Université d'Angers (LERIA)
> Tel: 02 41 73 52 06      Département Informatique
> Fax: 02 41 73 50 73     H203
> 
> 
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users




More information about the users mailing list