I have a CP Optimizer model (coded in Java) with integer variable vector `x`. Some entries in `x` are fixed in the problem. The following seemingly redundant code works when I create variable `x[i]` (where `j` is its required value).
x[i] = cp.intVar(j, j, "x_" + i);
cp.add(cp.eq(x[i], j));
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?
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
------------------------------
#DecisionOptimization