[gecode-users] Scheduling A Propagator After Backtrack

Christian Schulte cschulte at kth.se
Wed Apr 20 09:33:30 CEST 2016


Hi Yunus,



The point is: you cannot schedule a propagator during copying (the system will 
crash).



Copying lazily is normally an excellent idea, many Gecode propagators do it. 
One way to do it is to use a flag whether the propagator has been run. When 
you clone the propagator you set it to false and in the propagate() function 
you can check whether you have run the propagator.



Would that do for you?



Storing the whole previous domain sounds very excessive to me, though and 
integer sets are definitely not an efficient data structure for that purpose. 
Maybe you could also start thinking about maintaining less information?



Hope that helps.



Cheers

Christian



--

Christian Schulte, www.gecode.org/~schulte

Professor of Computer Science, KTH, cschulte at kth.se

Expert Researcher, SICS, cschulte at sics.se



From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf Of 
Yunus Acikoz
Sent: Wednesday, April 20, 2016 09:11
To: users at gecode.org
Subject: [gecode-users] Scheduling A Propagator After Backtrack



Hi,



I would like to know if it's possible to schedule a custom propagator such 
that it is immediately propagated after backtracking. I mean something like 
executing the code below in the copy function of the propagator:



        auto copy_propagator = new(home)AdvisedPropagator(home, share, *this);

        Gecode::Int::IntView::schedule(home, *copy_propagator, 
Gecode::Int::ME_INT_DOM);





So the newly generated copy of the propagator (without its council being 
copied) is scheduled to be run when the search engine turns back to that node. 
Does it make sense at all?



I use advisors and they consume too much memory. Each advisor holds the 
previous state of the domain of its subscribed view as an IntSet, an unsigned 
short index and an enum to keep info about which variable array it belongs to.

I want to initialize advisors lazily, so that they are only created when the 
propagator is actually used. I thought maybe I could do it in "propagate" 
function with an initial propagation.



Thanks in advance,

Cheers,

Yunus Acikoz

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20160420/1ec9521a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4623 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20160420/1ec9521a/attachment.bin>


More information about the users mailing list