[gecode-users] Variable update problem

Jérémie Vautard jeremie.vautard at gmail.com
Tue Jan 27 15:25:26 CET 2009


Hi !

I am coding a little stuff that needs to extract some potential  
partial solutions from a constraint problem. To do this, I have a  
(pointer to a)Gecode::Space S with an array of IntVar, and I do the  
following :
- I have initially propared a set of IntVarArgs, each containing a  
given subset of the variables of S.
- I create S2 to be a clone of S ( via S2 = S->clone(); )
- I choose one of the IntVarArgs I initially created, let's call it  
V, and I create a new IntVarArgs V2(V);
- I update all the variables of V2 so that they "become" variables of  
S2 : for (int i=0;i<V2.size();i++)   V2[i].update(S2,true,V[i]);
- I post a branching in S2 with the variables of V2. e.g. :   
Gecode::branch(S2,V2,INT_VAR_SIZE_MIN,INT_VAL_MIN);

However, when I search on S2 (with the DFS engine), the returned  
solution do not have the corresponding variables domain reduces to a  
singleton. (I check this via an IntVar public member of my  
Gecode::Space descendant class that I did not forget to update in the  
copy constructor :-) )

I join an small example that illustrates my issue : for this problem  
with one variable and no constraints, I obtain 2 solutions (this  
number is correct), but, for both of them, the 'v' member is still  
[0..1]...

I most likely have missed something, but I don't understand what....

I am working with Gecode 2.2.0.

Cheers,

-- 
Jérémie Vautard




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090127/207f0349/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: essai.cc
Type: application/octet-stream
Size: 820 bytes
Desc: not available
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090127/207f0349/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090127/207f0349/attachment-0001.htm>


More information about the gecode-users mailing list