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.
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
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 -
Hi Fulya,
You have to loop over the array and set the VType attribute for each GRBVar element individually.
Thanks,
Eli
1
Post is closed for comments.
Comments
5 comments