Skip to main content

Store time to find incumbent

Answered

Comments

3 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jaromił Najman
    • Gurobi Staff

    Hi Alejandro,

    You can define a private variable in the model object and set it in the callback

    def mycallback:
     # ...
    # in callback
    model._incumbenttime = model.cbGet(GRB.Callback.RUNTIME)

    # define private variable which can be set in callback
    model._incumbenttime = -1
    model.optimize(mycallback)
    print(model._incumbenttime)

    Best regards, 
    Jaromił

     

    0
  • Alejandro Arenas
    • Gurobi-versary
    • First Comment
    • First Question

    Thank you again.

    It works perfectly

    0

Post is closed for comments.