Pyomo / pyomo

An object-oriented algebraic modeling language in Python for structured optimization problems.
https://www.pyomo.org
Other
2.02k stars 518 forks source link

CPLEX's `mip.limits.solutions` parameter results in `SolutionStatus.error` #1333

Open ruaridhw opened 4 years ago

ruaridhw commented 4 years ago
  1. Run an optimisation with the CPLEX LP solver and add solver.options['mip_limits_solutions'] = some_positive_integer
  2. The solver status will be 'ok', the termination condition will be 'unknown', and the solution status will be 'error'

Arguably, the solution status should be treated in identical fashion to solver.options['timelimit'] = some_positive_integer. As should all other ways of user-imposed-limit termination.

Additionally, an actual termination condition could be parsed from the log file. Perhaps maxEvaluations is the most suitable? Having said that, it looks like this is deprecated because we do not insert the solution into results if this condition is met (which I don't quite understand).

bhimabi commented 4 years ago

Has there been a fix to this issue? I am getting a similar issue with the error "ValueError: Cannot load a SolverResults object with bad status: error" even though the solution is actually found. Status is set as bad for some reason

ruaridhw commented 4 years ago

@bhimabi, if you really need this fixed you can fork this repository and cherry-pick the commits from flexciton/pyomo!15. That said, those commits are not thoroughly tested (and there may be merge conflicts) so use with care!