Hi Zoe,
Here is a patch that adds a disable_afc() function to a propagator: you need to call it when the propagator is created and then all increments and are ignored. It is not tested though but should work (famous last words…). Good luck Christian -- Christian Schulte, www.gecode.org/~schulte Professor of Computer Science, KTH, <mailto:cschu...@kth.se> cschu...@kth.se Expert Researcher, SICS, <mailto:cschu...@sics.se> cschu...@sics.se From: ziche...@gmail.com [mailto:ziche...@gmail.com] On Behalf Of Zhu Zichen's cse Sent: Friday, January 23, 2015 4:13 PM To: cschu...@kth.se Cc: users@gecode.org Subject: Re: [gecode-users] AFC of a Propagator Dear Christian, The case you are worried is that when p and q have the same pruning effect and the existence of p would make q lost some chance to increase its AFC, right? This case would not happen a lot because my constraint has little chance to have the same pruning effect with the other constraints. Actually, I would post p1 and p2 to a CSP respectively which have the same pruning power. But they subscribe different subsets of variables. I would like to compare there pruning efficiency under the similar heuristics. Zoe On Fri, Jan 23, 2015 at 10:59 PM, Christian Schulte <cschu...@kth.se> wrote: Dear Zoe, No, the problem is that the AFC of _ q _ is not counted properly when you use it together with p! Is that not a problem? Cheers Christian -- Christian Schulte, www.gecode.org/~schulte Professor of Computer Science, KTH, cschu...@kth.se Expert Researcher, SICS, cschu...@sics.se From: ziche...@gmail.com [mailto:ziche...@gmail.com] On Behalf Of Zhu Zichen's cse Sent: Friday, January 23, 2015 3:57 PM To: cschu...@kth.se Cc: users@gecode.org Subject: Re: [gecode-users] AFC of a Propagator Dear Christian, You are worried that even though we do not count the AFC of p, the heuristic is not exactly the same with the one without posting p, right? It's acceptable. One reason is that my constraint does have the same pruning effect with other constraints in most of the cases. Another reason is that we do not require heuristics are exactly the same. So, just do not count AFC of p into its subscribed variables' AFC is enough. Regards, Zoe On Fri, Jan 23, 2015 at 10:28 PM, Christian Schulte <cschu...@kth.se> wrote: Hi Zoe, I have an idea for a fix (a hack let’s say) but I think it will not fix the problem you are trying to solve. Let me try to explain: when your own propagator p triggers failure then there are two effects. One is that the AFC is counted for p (this is the fix you ask for). But the other effect is that if p had not been there some other propagator q might have triggered failure and the AFC of q would have increased. But now q’s AFC will not be incremented. So, are you really sure that what you ask for will fix the issue? Because I’d hate to suggest a fix that will not solve the real problem anyway. Cheers Christian -- Christian Schulte, www.gecode.org/~schulte Professor of Computer Science, KTH, cschu...@kth.se Expert Researcher, SICS, cschu...@sics.se From: ziche...@gmail.com [mailto:ziche...@gmail.com] On Behalf Of Zhu Zichen's cse Sent: Friday, January 23, 2015 11:57 AM To: cschu...@kth.se Cc: users@gecode.org Subject: Re: [gecode-users] AFC of a Propagator Dear Christian, Yes, it would be very very nice if you can help to achieve that. Zoe On Fri, Jan 23, 2015 at 5:45 PM, Christian Schulte <cschu...@kth.se> wrote: Hi Zoe, No, by default that is not possible. In order to do it, one would have to really modify the kernel of Gecode. I think you need it badly, right? If yes, I could think about it. Best Christian -- Christian Schulte, Professor of Computer Science, KTH, www.gecode.org/~schulte/ From: users-boun...@gecode.org [mailto:users-boun...@gecode.org] On Behalf Of Zhu Zichen's cse Sent: Friday, January 23, 2015 6:47 AM To: users@gecode.org Subject: [gecode-users] AFC of a Propagator Dear all, Is it possible to not count a propagator's AFC into its subscribed variables' AFC? Because now I use INT_VAR_AFC_SIZE_MAX() variable heuristic while I do not want there is a big difference on the heuristic with or without adding my own constraint. Many thanks. Zoe
afc_disable.patch
Description: Binary data
_______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users