【问题标题】:Is there a way to know how much time is spent in Gurobi usercuts?有没有办法知道在 Gurobi usercuts 中花费了多少时间?
【发布时间】:2021-02-25 13:25:16
【问题描述】:

我正在使用 JuMP 数学优化界面用户通过 Gurobi 剪切回调

MOI.set(m, MOI.UserCutCallback(), callback_benders_usercuts)

我想知道是否有办法知道我的 usercut 函数 callback_benders_usercuts 花费了多少时间?

usercuts_time = 0
callback_benders_usercuts(arguments)
    usercuts_time += time()
    # ... computing
    usercuts_time += time() - usercuts_time
    return

不起作用,因为我认为callback_benders_usercuts 在许多节点上被调用并且我的变量自身互连。

我得到以下明显不正确的:

 [ Info: Spent 1.614e9s in User cuts

【问题讨论】:

    标签: optimization time julia julia-jump


    【解决方案1】:

    你想要的

    callback_benders_usercuts(arguments)
        t = time()
        # ... computing
        usercuts_time += time() - t
        return
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-10-08
      • 1970-01-01
      • 2019-03-13
      • 1970-01-01
      • 2019-03-21
      • 2020-05-15
      • 2011-07-31
      • 1970-01-01
      相关资源
      最近更新 更多