Skip to main content

How to set the output time to be displayed as a real number.

Answered

Comments

2 comments

  • Official comment
    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?.
  • Jaromił Najman
    • Gurobi Staff

    Hi,

    Currently there is no such option. If you are using an API to call Gurobi, you can define a callback, e.g., the MESSAGE callback, and retrieve the solution time via the RUNTIME \(\texttt{what}\) attribute by using the cbGet function.

    A short example in Python would be

    def mycallback(model, where):
    if where == GRB.Callback.MESSAGE:
    print(model.cbGet(GRB.Callback.RUNTIME))

    [...]
    model.optimize(mycallback)

    Best regards,
    Jaromił

    0

Post is closed for comments.