No, you need to keep advisor and council: they will not take much memory, it’s 
really the sets that eat memory. That might mean that you have to take out the 
integer set information from your advisors (you do not say so but that is my 
guess here). Subscriptions by propagators also take memory!

 

Then you need to check the flag when an advisor is run. That should work.

 

Cheers

Christian

 

--

Christian Schulte, www.gecode.org/~schulte

Professor of Computer Science, KTH,  <mailto:[email protected]> [email protected]

Expert Researcher, SICS,  <mailto:[email protected]> [email protected]

 

From: Yunus Acikoz [mailto:[email protected]] 
Sent: Wednesday, April 20, 2016 09:52
To: Christian Schulte
Cc: [email protected]
Subject: Re: [gecode-users] Scheduling A Propagator After Backtrack

 

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 <[email protected]> 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, [email protected]

Expert Researcher, SICS, [email protected]

 

From: [email protected] [mailto:[email protected]] On Behalf Of 
Yunus Acikoz
Sent: Wednesday, April 20, 2016 09:11
To: [email protected]
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

 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Gecode users mailing list
[email protected]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to