我正在使用Python中的“pulp”与GUROBI一起解决一些优化问题。例如,GUROBI的计算日志如下:
Optimize a model with 12 rows, 25 columns and 39 nonzeros
Coefficient statistics:
Matrix range [1e+00, 1e+00]
Objective range [1e+00, 1e+00]
Bounds range [1e+00, 1e+00]
RHS range [1e+00, 1e+00]
Found heuristic solution: objective 12
Presolve removed 3 rows and 12 columns
Presolve time: 0.00s
Presolved: 9 rows, 13 columns, 27 nonzeros
Variable types: 0 continuous, 13 integer (13 binary)
Root relaxation: objective 7.000000e+00, 11 iterations, 0.00 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
* 0 0 0 7.0000000 7.00000 0.00% - 0s
Explored 0 nodes (11 simplex iterations) in 0.00 seconds
Thread count was 4 (of 4 available processors)
Optimal solution found (tolerance 1.00e-04)
Best objective 7.000000000000e+00, best bound 7.000000000000e+00, gap 0.0%
('Gurobi status=', 2)
我想禁用这个输出,因为我要解决800k的优化问题,而且在输出中写入这些日志会使我的代码变得太慢。有什么方法可以禁用这些日志吗?