I am using Docplex (Cplex python version) with a minimization objective. As it takes a long time to find the optimum I would like to set a timelimit and receive the found solution at that time. To limit the time I have tried the following but it does not work. Can anyone give me a hint on how to implement it?
import docplex.cp.parameters as params
def solve_model():
params.timelimit = 1
result = model.solve()
Also I have tried
model.parameters.timelimit = 1
I do not get any errors. The model is solved correctly but the timelimit is exceeded.