"Variable not in model" for Bilinear.java example
AnsweredHi,
should firstly note that using v9.5 the Mip1 java example didn't work for me, at least in my jar lib
GRBEnv GRBEnv(boolean empty)
was undefined. I moved on to trying Bilinear.java but am now being met with error code 20001, Variable not in model. My code is a direct copy paste of the example code found here https://www.gurobi.com/documentation/9.5/examples/bilinear_java.html , it fails on the line
model.setObjective(obj, GRB.MAXIMIZE);
I will move on to to trying another example but just wondering if there is some versioning problems between the online documentation and the 9.5 java version. Given these two issues I have come across yesterday.
Cheers,
Alex
-
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 try Gurobot, our chatbot interface offering instant, expert-level support. -
I am now getting a very similar error in the Diet.java example on the line
model.addConstr(ntot, GRB.EQUAL, nutrition[i], Categories[i]);
0 -
I have realized that in some old code from a colleague in the same repository there is a Gurobi 5.6 jar that is being included instead of my 9.5 jar. This is most likely the root of the problem and I will close this post if the problem is gone once I resolve the build configs.
0 -
Resolved
0
Post is closed for comments.
Comments
4 comments