Relaxed variable in Java API
回答済みHello support team,
I define an integer variable as following:
GRBVar[][] start = new GRBVar[mach.length][item.length];
for (int m = 0; m < mach.length; m++) {
for (int k = 0; k < item.length; k++) {
start[m][k] = model.addVar(0, 200, 0, GRB.INTEGER, "start" + m + "." + k);
}
}
I need to convert the integer variable to the continuous variable without changing in the initial definition.
Would you say that is there any way to cast it?
Regards
Omidi. A
0
-
正式なコメント
Hi Abbas,
you can change the type of a variable with by settings it's variable type attribute. E.g., start[0][0].set(GRB.CharAttr.VType, GRB.CONTINUOUS).
Best,
Michael
-
Hi Michael,
Thanks for your advice. It works fine.
Regards
Abbas
0
サインインしてコメントを残してください。
コメント
2件のコメント