Store time to find incumbent
AnsweredHello everybody.
Now I know that I must use a callback to know when an incumbent was found. Is there any way to store this value?
Thanks a lot!!
0
-
Official comment
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. -
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 -
Thank you again.
It works perfectly
0
Post is closed for comments.
Comments
3 comments