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

Storing gap and runtime

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

コメント

2件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two 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.
  • Jaromił Najman
    • 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

投稿コメントは受け付けていません。