使用from docplex.cp.model import CpoModel
我编写了一个 docplex 代码。模型定义如下。
mdl = CpoModel(name="HouseBuilding")
但是通过solve()函数,它最终打印了带有解决方案的不必要的输出。
msol = mdl.solve(TimeLimit=10)
我相信它正在打印下面的东西。
solve status,
solver parameters,
solver information
output log
示例输出如下。我应该如何避免打印这些信息而只打印解决方案。
! -------------------------------------------------- CP Optimizer 12.10.0.0 --
! Maximization problem - 153 variables, 123 constraints
! TimeLimit = 10
! Initial process time : 0.00s (0.00s extraction + 0.00s propagation)
! . Log search space : 330.1 (before), 330.1 (after)
! . Memory usage : 926.0 kB (before), 926.0 kB (after)
! Using parallel search with 4 workers.
! ----------------------------------------------------------------------------
! Best Branches Non-fixed W Branch decision
0 153 -
+ New bound is 385
! Using iterative diving.
! Using temporal relaxation.
0 153 1 -
+ New bound is 372
* 309 155 0.12s 1 (gap is 20.39%)
* 313 387 0.12s 1 (gap is 18.85%)
* 315 552 0.12s 1 (gap is 18.10%)
315 1000 2 1 F !presenceOf(H4-facade(Jack))
* 340 1480 0.12s 1 (gap is 9.41%)
340 2000 2 1 230 = startOf(H3-garden(Jim))
* 346 2343 0.12s 1 (gap is 7.51%)