[gecode-users] Question About Function of Gecode with SetVar
Carlos Cerrano
carl.cerr at gmail.com
Fri Jun 26 19:43:35 CEST 2009
I offer excuses for the wrong message, this is the correct message:
I am trying to use Gecode for solve this problem:
I have two SetVar and each one must satisfy the constraints:
1.To have a domain in an interval defined between your position in the
SetVarArray and your position + n , for example , if n=3:
dom(setvar1)= {1..4}
dom(setvar2)={2..5}
2.The domain of each variable must be Subset of other SetVar called
Sets_Possibles.
I believe that this model:
class model : public model {
public:
SetVarArray t;
SetVar Sets_Possibles;
void explore(Space* root, Gist::Inspector* i){
(void ) Gecode::explore(root,i);
}
model():t(this,2,IntSet::empty, IntSet(1,10),4,4),
Sets_Possibles(this,IntSet::empty,1,6,4,4)
{
for(int i=0; i < 2; i++){
dom(this,t[0],SRT_EQ, i+1, i+3);
rel(this,t[0], SRT_SUB,Dia1SetVar);
}
branch(this, t, Gecode::SET_VAR_NONE, SET_VAL_MAX);
}
model(bool share, model& m) : Space(share,m) {
t.update(this, share, m.t);
Sets_Possibles.update(this, share, m.Sets_Possibles);
}
....
Should throw the solutions t[0]= {1..4} t[1]= {2..5}, but I do not obtain
any solution,so, someone can help me with an idea about why it does not
work.
Thanks for your great patience and any colaboration.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090626/60ec0f33/attachment.htm>
More information about the gecode-users
mailing list