简体   繁体   English

静默来自 Python mip 的日志输出

[英]Silence Log Output From Python mip

I'm using the mixed integer programming module https://pypi.org/project/mip/ and it's working a treat.我正在使用混合整数编程模块https://pypi.org/project/mip/并且它正在工作。 However, it's printing logging information to the console at termination of the program.但是,它会在程序终止时将日志信息打印到控制台。

Cgl0003I 0 fixed, 15 tightened bounds, 0 strengthened rows, 0 substitutions
Cgl0004I processed model has 131 rows, 8 columns (8 integer (0 of which binary)) and 1038 elements
Coin3009W Conflict graph built in 0.001 seconds, density: 0.000%
Cgl0015I Clique Strengthening extended 0 cliques, 0 were dominated
Cbc0045I 1 integer variables out of 8 objects (8 integer) have cost of 1 - high priority
Cbc0045I branch on satisfied Y create fake objective Y random cost Y
Cbc0012I Integer solution of 5 found by DiveCoefficient after 0 iterations and 0 nodes (0.01 seconds)
Cbc0012I Integer solution of 2 found by DiveCoefficient after 8 iterations and 0 nodes (0.01 seconds)
Cbc0031I 1 added rows had average density of 8
Cbc0013I At root node, 1 cuts changed objective from 1.4444444 to 2 in 2 passes
Cbc0014I Cut generator 0 (Probing) - 0 row cuts average 0.0 elements, 1 column cuts (1 active)  in 0.000 seconds - new frequency is 1
Cbc0014I Cut generator 1 (Gomory) - 3 row cuts average 7.7 elements, 0 column cuts (0 active)  in 0.001 seconds - new frequency is 1
Cbc0014I Cut generator 2 (Knapsack) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.000 seconds - new frequency is -100
Cbc0014I Cut generator 3 (Clique) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.000 seconds - new frequency is -100
Cbc0014I Cut generator 4 (OddWheel) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.000 seconds - new frequency is -100
Cbc0014I Cut generator 5 (MixedIntegerRounding2) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.001 seconds - new frequency is -100
Cbc0014I Cut generator 6 (FlowCover) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.000 seconds - new frequency is -100
Cbc0001I Search completed - best objective 2, took 8 iterations and 0 nodes (0.01 seconds)
Cbc0035I Maximum depth 0, 0 variables fixed on reduced cost
Total time (CPU seconds):       0.02   (Wallclock seconds):       0.02

How can I silence all non-error output from mips?如何使 mips 的所有非错误输出静音?

Before calling打电话之前

m.optimize(...)

set

m.verbose = 0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM