1

CPLEX prints out nice node logs, how can I get them using docplex? I've tried changing content.solver.verbose and log_output but I'm not getting the information (current solution, gap) to print.

I'm using this code:

context.solver.log_output = True
context.solver.verbose = 5
mdl = CpoModel()
mdl.solve()

With verbose = 5, all of the branch decisions are printed (lots of junk) With verbose = 4, the gap is not printed

Community
  • 1
  • 1
MLE
  • 69
  • 6

2 Answers2

4

The following works for me:

model = build_model()
model.context.solver.log_output = True
model.solve()

If this does not work for you, can you please provide some sample code so that we can have a look at it ? Thanks

Viu-Long
  • 41
  • 3
0

I ended up using the code in the question and filtering output with grep.

MLE
  • 69
  • 6