I'm trying to formulate a VRPTW model in Java, same one in OPL works just fine, but I keep getting problem with one constrain:
a[i][k]+t[i][j]- a[j][k] + M * x[i][j][k] = M
I get error mesagge: The method addTerm(double, IloNumVar) in the type IloLinearNumExpr is not applicable for the arguments (double). It seams that it is a problem only with t[i][j] which is double and calculated based on two other doubles: t[i][j] = d[i][j]+ s[i];
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
for(int k = 0; k < v; k++) {
if(i != j) {
IloLinearNumExpr expr8 = cplex.linearNumExpr();
expr8.addTerm(1.0, a[i][k]);
expr8.addTerm(t[i][j]);
expr8.addTerm(-1.0, a[j][k]);
expr8.addTerm(M, x[i][j][k]);
cplex.addLe(expr8, M);
Any ideas are welcome. Thank you!