Sorry if I missed out simple stuff from the docs but is there a built-in allSame constraint (all values in IntVar are the same) or how do I go and implement this?
No, there is no global constraint allSame but you can simply implement it by the following code
IntVarr a = …
for (int i=0; i<a.length; i++)
for (int j=0; j<a.length; j++)
impose.store(new XeqY(a_, a));
That would work.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.