pylpsolve icon indicating copy to clipboard operation
pylpsolve copied to clipboard

Add support for 'timeout' parameter.

Open rwe opened this issue 8 years ago • 0 comments

Provides support for the timeout parameter. The timeout parameter is the positive integer seconds before either returning the optimal result or raising a timeout error.

The parameter defaults as 0, meaning no timeout.

In current hotyak/pylpsolve@master, if a timeout occurrs and is infeasible, a general LPException will be raised, identified by the message "Error 7: Timeout Occurred.". If a timeout occurs and the result was feasible, a warning will be printed with the string ""Solver solution suboptimal".

Under #7, if a timeout occurs and is infeasible, an LPTimeout instance will be raised. If a timeout occurs and the result is feasible, an LPSuboptimalException is raised instead (and the solver result can be used). This allows a timeout to be set, preventing unbounded computation, while still being able to programmatically identify a suboptimal result.

rwe avatar Mar 13 '16 08:03 rwe