I'm back at Linear Expressions with Google Or Tools CP Sat in Java. Clunky doesn't describe it even close, Java is a mess here.
My goal is to add a constant to my IntVar and exclude this value for the next IntVar.
(Btw. it's already awkward how i add a constant to my IntVar, is there any other way?)
IntVar a = model.newIntVar(0, someValue, "a");
IntVar b = model.newIntVar(0, someValue, "b");
IntVar one = model.newIntVar(1, 1, "I have to do this");
LinearExpr expr = LinearExpr.scalProd(new IntVar[] {a, one}, new int[] {1, constant}) // a + constant
model.addDifferent(b, expr) // Error because addDifferent is only usable with (IntVar, IntVar)
How can I implement addDifferent with IntVar and LinearExpression?