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

Assigning an objective value of -1000, when the model is infeasible

回答済み

コメント

2件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    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?.
  • Eli Towle
    • Gurobi Staff

    \( \texttt{GRB.OPTIMAL} \) is a fixed constant representing the "optimal" status. To check if a model is infeasible, compare the Model object's Status attribute to the appropriate status code:

    if m.Status == GRB.INFEASIBLE:

    Also, you can retrieve the objective function value directly with the ObjVal model attribute (e.g., \( \texttt{m.ObjVal} \)).

    0

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