Change variable type?
AnsweredHi,
I want to relax the integrality constraint on the variable. What I mean that I want to change variable type from integer to continuous type?
How can I do this in Gurobi?
Thank you in advance.
-
Hi Fulya,
You have to loop over the array and set the VType attribute for each GRBVar element individually.
Thanks,
Eli
1 -
Thank a lot. I got an error such as Cannot invoke set(GRB.CharAttr, char) on the array type GRBVar[].
Since my object is GRBVar[]. How will I make for array type GRBVar?
Thank you in advance
0 -
for (Map.Entry<String, GRBVar[]> varEntry : DecVariables.entrySet()) //IloIntVar[]
varEntry.getValue(). set(GRB.CharAttr.VType, GRB.CONTINUOUS); // The error message: Cannot invoke set(GRB.CharAttr, char) on the array type GRBVar[]0
Please sign in to leave a comment.
Comments
4 comments