[gecode-users] Removing constraints in running time

Christian Schulte schulte at imit.kth.se
Fri Mar 31 14:08:50 CEST 2006


Hi,

the sad news is that you can't do that at all! The only thing you can do is
to recreate the space without the constraints.

Constraint removal is difficult as it entails not only the removal of the
constraints but also undo the effects of propagation. Gecode does not
support this.

flush() is meant to flush propagation caches, it has no effect on the space
but on the internal management of some propagators.

Cheers
Christian


--
Christian Schulte, http://www.imit.kth.se/~schulte/ 
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Efstratios Kalogirou
Sent: Friday, March 31, 2006 1:50 PM
To: users at gecode.org
Subject: [gecode-users] Removing constraints in running time


Hi all, 

I am trying to undo the effect of posting a constraint in running time. The
idea is to let the user redefine new constraints from the command line
[removing the old ones] and check the status of the problem while the
variables of my Space and their domain remain the same. 

I am trying to do something like:
    //several postings here
    post(this,q[0]==q[1]);
    unsigned int alt;
    status(alt);
   //Remove the old constraints 
   flush();
   //Create new constraints here

but it doesn't work.I was hoping to avoid creating a clone or copy of the
old Space, since it's the same Space with new constraints and the old ones
removed. Any ideas?

Best,
Stratos Kalogirou





More information about the gecode-users mailing list