Have a taskInfomation(list) include distribution center (0) and lots of tasks,so how to model in gurobi use java? As follow the picture.xijrk is binary variable
for (int k = 0; k < VehicleInfo.size(); k++) {
for (int r = 0; r < Route.getTrip(); r++) {
for (int i = 0; i < 1; i++) {
for (int j = 1; j < taskInfo.size()-1; j++) {
GRBLinExpr expr = new GRBLinExpr();
expr.addTerm(1, csVariable.x[i][j][k][r]);
model.addConstr(expr, GRB.Less_EQUAL, 1, "name" + i + "_" + j + "_" + k + "_" + r);
}
}
}
}
New contributor
ALL to well is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.