Skip to main content

Store time to find incumbent

Answered

Comments

2 comments

  • Jaromił Najman
    Gurobi Staff 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

Please sign in to leave a comment.