Store time to find incumbent
回答済みHello 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
-
正式なコメント
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
投稿コメントは受け付けていません。
コメント
3件のコメント