メインコンテンツへスキップ

Storing gap and runtime

ユーザーの入力を待っています。

コメント

1件のコメント

  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    Hi Min,

    When I run the model, I get this error: list index out of range for m._data[-1]. It does not happen all the time, but it does  happen for some occasions. 

    It is possible that a model is solved in Presolve and thus will never reach the MIP callback. Could you show the log output of a case where this error occurs?

    In such cases you should always first check the size of \(\texttt{m._data}\) via \(\texttt{len(m.data)}\). If the length is \(0\) but the status is \(\texttt{GRB.OPTIMAL}\), you can still compute one data point via accessing the model attributes ObjVal, ObjBound, and RunTime.

    Another question I have is that the r loop completely stops when there is no optimal solution. Is there a way to jump to the next iteration even when no solution can be found? 

    I don't see why the loop should completely stop. The sys.exit line is commented out. Couldn't you just use the \(\texttt{continue}\) keyword in the non-optimal case?

    Best regards, 
    Jaromił

    0

サインインしてコメントを残してください。