model.addConstr() does not work?
Answered
Hii
does anybody know why this code gives
Error code = 20001
Not in the model
message ?
GRBVar v1, v2;
v1 = model.addVar(-10, 10, 0, GRB_CONTINUOUS);
model.addGenConstrAbs(v2, v1);
0
-
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?. -
Hi Jozsef,
Before adding a constraint that includes v2, can you try first adding v2 to the model with the GRBModel.addVar() method (like you do with v1)? You declare v2 to be of type GRBVar, but it is not defined for any particular model.
Thanks!
Eli
0
Post is closed for comments.
Comments
2 comments