[gecode-users] Question About Function of Gecode with SetVar

Carlos Cerrano carl.cerr at gmail.com
Fri Jun 26 19:23:20 CEST 2009


/*Hello guys, I am trying to use Gecode por solve this simple problem:
 * I have two SetVar  and cada una debe cumplr las restriccioens:
 * 1. debe tener un  dominio en un intervalo  definido entre su posision  y
su posicion + n ,
 *  .Por example ,si n=3
 *       dom(setvar1)= {1..4}
 *       dom(setvar2)={2..5}
 * 2.el dominio  de cada variable debe ser Subset  de  otra variable de
conjuntos Sets_Possibles

I think this   model must function:
class model : public model {
        public:
                SetVarArray t;//
                SetVar Sets_Possibles;

                //Sets_Possibles  : keeps between others , the sets:
{1,2,3,4} {2,3,4,5} {3,4,5,6}
                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++){//for each SetVar in t
                                dom(this,t[0],SRT_EQ, i+1, i+3);
                                rel(this,t[0], SRT_SUB, Sets_Possibles);
                        }
                        branch(this, t, Gecode::SET_VAR_NONE,  SET_VAL_MAX);
                }

                model(bool share, model& m) : Space(share,m) {
                        Sets_Possibles.update(this, share,
m.Sets_Possibles);
                }






, i wait the solutions:
 setvar1= {1,2,3,4}
 setvar2= {2,3,4,5}
 but this don't found solutions , so, can something ayudarme a entender  why
this model don't function, cualquier idea es bienvenida,gracias.
 * */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090626/7ac4bc38/attachment.htm>


More information about the gecode-users mailing list