If I use the interactive solver in the gurobi solver, I can do the following:
(如果在gurobi求解器中使用交互式求解器,则可以执行以下操作:)
gurobi> m = read('model.mp')
gurobi> m.optimize()
[...]
Found heuristic solution: objective 821425.00000
Then abort and get the current solution via
(然后中止并通过获取当前解决方案)
gurobi> m.printAttr('X')
I want to have the same behavior in pulp.
(我希望在纸浆中具有相同的行为。)
In particular, after having called: (特别是在致电之后:)
prob = pulp.LpProblem(name="MIPProblem", sense=pulp.LpMaximize)
[...]
status = prob.solve(pulp.GUROBI_CMD(msg=True, keepFiles=1))
I want to wait until the first heuristic solution is found/abort after a certain timespan and then obtain the current best solution found by Gurobi.
(我想等到某个时间间隔后找到/中止第一个启发式解决方案,然后获得Gurobi找到的当前最佳解决方案。)
How would I do that? (我该怎么做?)
ask by securitymensch translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…