Hi,
let's go on with the example from https://www.linkedin.com/pulse/what-optimization-how-can-help-you-do-more-less-zoo-buses-fleischer/
Let's see now how easy it is to add some CPLEX settings:
from docplex.mp.model import Model
mdl = Model(name='buses')
mdl.parameters.timelimit=20;
mdl.set_time_limit(20) #The same
nbbus40 = mdl.integer_var(name='nbBus40')
nbbus30 = mdl.integer_var(name='nbBus30')
mdl.add_constraint(nbbus40*40 + nbbus30*30 >= 300, 'kids')
mdl.minimize(nbbus40*500 + nbbus30*400)
mdl.solve()
mdl.export("c:\\buses.lp")
print("time limit = ",mdl.parameters.timelimit.get())
print("time limit = ",mdl.get_time_limit()) #The same
for v in mdl.iter_integer_vars():
print(v," = ",v.solution_value)
which gives
time limit = 20
time limit = 20
nbBus40 = 6.0
nbBus30 = 2.0
regards
PS: Many CPLEX settings at https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/introListAlpha.html
#CPLEXOptimizers#DecisionOptimization