[gecode-users] IntVarArray

Alexis Cothenet alexis.cothenet at gmail.com
Mon Mar 12 09:48:32 CET 2012


Hi all,

I'm trying to model something with Gecode:

I'm used with ILOG to add constraints like this:

I have 2 variables for example :
IntVar toto1 ([0,1,2])
IntVar toto2 ([0,2]).


I have a relationship with the preceding domain values :
Array [0] = 8
Array [1] = 9
Array [2] = 8

I have an intVarArray:
IntVarArray glob;
glob << Array [toto1] (domain = [8,9])
glob << Array [toto2] (domain = [8])

And add constraint:
distinct (glob);

So that it constrains glob[0] ->[9] and so it constrains toto1->[1]

Could you explain me how i could model it with Gecode ?

Thank you.
Best regards,
Alexis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20120312/22fc4a4b/attachment.htm>


More information about the users mailing list