Hi Javier,
Yes, I think that is the best you can. I would create a new integer variable
u with appropriate bounds and post the constraints in the following order:
u <= y and element(x,z,u)
If you use minimodeling support by writing
rel(home, element(x,z) <= y)
everything will be done for you automatically.
Cheers
Christian
--
Christian Schulte, www.gecode.org/~schulte
Professor of Computer Science, KTH, [email protected]
Expert Researcher, SICS, [email protected]
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Javier Larrosa
Sent: Friday, March 20, 2015 11:20 AM
To: [email protected]
Subject: [gecode-users] Arithmetic element
Hi,
I am working in a scheduling problem and I need to post a constraint
x[z]<=y, where x is an IntVarArray, z is an IntVar and y is a constant (but
in general could be another variable).
It is close to the element constraint which allows to post the constraint
x[z]==y. What is the best way to do it?
best,
Javier Larrosa
_______________________________________________
Gecode users mailing list
[email protected]
https://www.gecode.org/mailman/listinfo/gecode-users
_______________________________________________
Gecode users mailing list
[email protected]
https://www.gecode.org/mailman/listinfo/gecode-users