Hi, you're trying to add values to a domain of an IntVar, and that's not possible. You need to initialise the domain with the right values (see the constructors that take an IntSet) or initialise it with a superset (eg {0,1,2,3} in your case) and then remove the elements you don't want, eg using a dom constraint.
Cheers, Guido -- Guido Tack On 9 Nov 2015, at 19:50, mehdi m <medis...@hotmail.fr> wrote: Hi everyone, In my model i have an IntVarArray X with size 3 = [X1, X2, X3] The domains must be : D(X1) = {1,2,3} D(X2) = {0,2,3} D(X3) = {0,3} For this, i do : X1 : X[1] = IntVar(*this, 1, 3); X2..X3 : for (int i = 2; i <= 3; i++){ X[i] = IntVar(*this, i, 3); } So for X2 and X3 i need to add the value 0, and i saw in mpg that only IntVarArgs can grow dynamically by adding value with "<<" operator, so is there any way to add a value in IntVarArray ? especially that the IntVarArray in my model can be large. Thanks _______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users
_______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users