[gecode-users] Posting a constraint on a IntVarArray that depends to other IntVarArray

Juan Carlos carlvall at gmail.com
Thu Jan 10 11:47:20 CET 2008


Thank you very much!, I didn't know about the reified feature.

On Jan 10, 2008 3:22 AM, Guido Tack <tack at ps.uni-sb.de> wrote:


> It depends on the constraint that you want to post.  If it can be
> reified, you can write
>
> BoolVar bb(this,0,1);
> post(this, eqv(~(a[i] < 4), bb));
> BoolVar notBb(this,0,1);
> rel(this, bb, IRT_NQ, notBb);
> constraint1(this, b[a[i]], bb);
> constraint2(this, b[a[i]], notBb);
>
> (Where you'd have to replace b[a[i]] by the proper call to element etc.)
>
> If there is no reified version for the constraint, I don't know any
> straight-forward solution except decomposing the constraint into
> smaller constraints that can be reified (not the best solution,
> certainly).
>
> Cheers,
>        Guido
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080110/ee1c9cef/attachment.htm>


More information about the gecode-users mailing list