Error at GRBVar.get
回答済みHello, I need to find if the optimal solution found is a degenerate solution.
Being that there's no default method to do that my idea was, after optimising, to iterate through model.getVars() and check if there's some variable set to 0.
var.get(GRB.IntAttr.VBasis) == GRB.BASIC ...
(Placing the three dots because I still need to check the value of the var)
The problem is that I get this error and after struggling for hours I still can't find a solution
com.gurobi.gurobi.GRBException: Error at GRBVar.get
at com.gurobi.gurobi.GRBVar.get(GRBVar.java:84)
-
Hi Samuele,
The error you're encountering,
com.gurobi.gurobi.GRBException: Error at GRBVar.get
is usually triggered due to accessing an attribute that is not available.The
VBasis
andCBasis
attributes can only be queried when a simplex basis is available (a basis is available when a continuous model has been solved using primal simplex, dual simplex, or barrier with crossover). For example, these attributes are not available if you're solving via the barrier method without crossover. Please check if this is the case for your model.Best regards,
Simran0 -
Thank you very much! I was solving an integer problem
Variable types: 0 continuous, 308 integer (154 binary)
but I've just realised I was doing wrong and I need to switch to a continuous problem.
0
サインインしてコメントを残してください。
コメント
2件のコメント