x[i] = cp.intVar(j, j, "x_" + i);
If I comment out the second line, however, the solver takes the liberty of setting `x[i]` to something other than `j`. (Specifically, in at least one instance `j` is 1 and the variable is assigned the value 4.) According to the documentation for `IloModeler.intVar()`, the first two arguments are bounds on the variable. Am I missing something, or is this a bug?
I did not manage to reproduce this with any small code.
You use cp.exportModel to dump your model and check that nothing unexpected is happening before CP Optimizer gets to see your model.
Another thought is that x[i] is overwritten with another variable in your program and then you pick up the value of the wrong variable after the solve.
Please let me know how you get on.
x[i] = cp.intVar(j, j, "x_" + i);cp.add(cp.eq(x[i], j));