1

I was able to find the documentation of the CPLEX automatic tuning tool, namely (the IBM Studio) but I couldn't find any for the docplex one (the cplex python api). Does the tuning tool exist for python? if yes is there any documentation to use this tool? Thank you in advance for the help. Best regards.

sel
  • 942
  • 1
  • 12
  • 25

1 Answers1

2

This question was answered here on the official IBM developerWorks forum.

In short, you can't use the tuning tool directly from docplex. However, it is possible to grab the the underlying cplex.Cplex instance (from the CPLEX Python API), like so:

cpx = m.get_engine().get_cplex()

where m is an instance of docplex.mp.model.Model (this tip comes from the thread here). With that instance in your hands, you can do something like the following:

status = cpx.parameters.tune_problem()                                          
if status == cpx.parameters.tuning_status.completed:                            
    print("tuned parameters:")                                                  
    for param, value in cpx.parameters.get_changed():                           
        print("{0}: {1}".format(repr(param), value))                            
else:                                                                           
    print("tuning status was: {0}".format(                                      
        cpx.parameters.tuning_status[status]))
rkersh
  • 4,447
  • 2
  • 22
  • 31