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
-
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
Please sign in to leave a comment.
Comments
2 comments