Originally posted by: SystemAdmin
Hi everybody,
I will really appreciate you to help me in advances. I write an algorithm with python. In each iteration of my algorithm, CPLEX solver is used to solve the model. But, some times the problem is not feasible and CPLEX get the "No solution exists CPLEX.CpxException: CPLEX Error 1217". So, this solution should be ignored and the heuristic continuing. However, at this stage the CPLEX is finished! How can I return the value of this error that is 1217 in the solution. I tried to use the CPLEX.CpxException that didn't work for me.
I want a command such as:
if CPLEX error != 1217 :
do the following commands
in the IBM site mention to the following commands that doesn't for me!
except CplexSolverError as exc:
if exc.args[2] == cplex.exceptions.error_codes.CPXERR_NO_SOLN:
...
Could you please guide me how to return the code of this error in the solution?
Regards
Alan Kurd
#CPLEXOptimizers#DecisionOptimization