Dear David, That is quite simple: in fact, rewriting a propagator p into a propagator q is nothing but posting q and returning that p is subsumed. The reason why there is in fact a special macro is that the macro firsts calls the dispose() member function of p, then posts q, and then p returns E_SUBSUMED (check the definition of GECODE_REWRITE in gecode/kernel/macros.hpp). But this is an optimization.
So what you can do: - just post all propagators (make sure to pass home(*this) as first argument to the post function, this makes sure that some information is inherited from the propagator to be rewritten). - return ES_SUBSUMED of the propagator to be rewritten. That's all! Cheers Christian -- Christian Schulte, www.gecode.org/~schulte Professor of Computer Science, KTH, cschu...@kth.se Expert Researcher, SICS, cschu...@sics.se -----Original Message----- From: users-boun...@gecode.org [mailto:users-boun...@gecode.org] On Behalf Of David Rijsman Sent: Wednesday, March 04, 2015 9:23 AM To: users@gecode.org Subject: [gecode-users] Rewriting propagators into more than one propagator Dear All, How can I rewrite a propagator during cloning (or propagation) into more than one propagator? The example in the MPG all rewrite propagators into one other propagator. Reason for wanting is that I have a propagator P with complexity n-square so it pays of to rewrite into two or more P propagators if by value of the variables the propagators become independent. David J. Rijsman R&D Optimization Lead Quintiq T +31 73 691 0739 M +31 6 2127 6829 Skype: quintiq.david www.quintiq.com _______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users _______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users