[gecode-users] Scheduling A Propagator After Backtrack

Yunus Acikoz yunusacikoz at gmail.com
Wed Apr 20 09:51:57 CEST 2016


Using a flag is a good idea, but without initializing the council and the
advisors, there's nothing to run the propagator if I understood correctly.
Am I right?
How about subscribing the propagator to views in the beginning and then
canceling the subscription once the advisors are initialized in the first
call of propagate()?  To be honest, it doesn't sound very wise to me but
just an idea.

About the previous domain thing: I need to know which values are removed
from my integer views to use them in a labeling algorithm. That was the
only way I could think of.

Cheers,
Yunus Acikoz

On Wed, Apr 20, 2016 at 10:33 AM, Christian Schulte <cschulte at kth.se> wrote:

> 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/40c4ebe2/attachment-0001.html>


More information about the users mailing list