I have a problem, i need to know how to implement a constraint with 9 intVars, for a example i have a+b+c+d+f+g+h+i<1000, how do i do that on Jacop?
You can use the Sum constraint to do this. For example if vars is an array of IntVar:-
store.impose( new Sum(vars,total));
store.impose( new XlteqC(total, 1000));
Will ensure that the total of all the elements of vars is kept in total, and this is <= 1000.
Thanks, i appreciate yor help.
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.