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

If solver hits time limit, is a solution output?

回答済み

コメント

4件のコメント

  • 正式なコメント
    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?.
  • Yuriy Zinchenko
    • Gurobi Staff

    Yes, the incumbent (if such is found) will be accessible through 'x' field of you variables.

    0
  • Sam Ganzfried
    • Gurobi-versary
    • Conversationalist
    • First Question

    I just tried an example where model.get(GRB.IntAttr.Status) had a value of 9 (TIME_LIMIT status),

    and when I call get(GRB.DoubleAttr.X)

    I get:

    Exception in thread "main" gurobi.GRBException: Error at GRBVar.get
    at gurobi.GRBVar.get(GRBVar.java:124)

     

     

    0
  • Yuriy Zinchenko
    • Gurobi Staff

    You should check if the incumbent was found first, before querying for the X property.  You can do this by checking SolCount, https://www.gurobi.com/documentation/9.0/refman/solcount.html#attr:SolCount

    (please see our examples for more illustration in the online doc)

    0

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