r-opt / rmpk

Mixed Integer Linear and Quadratic Programming in R
https://r-opt.github.io/rmpk/
Other
44 stars 4 forks source link

Make solver status more accessible #65

Closed prubin73 closed 2 years ago

prubin73 commented 2 years ago

A user may want to know the solver's final status (optimal, feasible, infeasible, unbounded, ...). Right now the RMPKMipModel class provides a termination_status() function, but it returns an object of a class the user will not recognize (for instance, MOI_success_termination_status_code) with no methods that I can find. That is not useful for output purposes. The termination_solver_message() function provides a list containing a status field, but the status is a numeric code (specific to the solver, I assume) that again will mean nothing to most users.

One possible resolution is to change the return value of the termination_status() function to a string (or something that is automatically converted to a string when it is an argument to print() or cat()).

dirkschumacher commented 2 years ago

Thanks. I agree this needs to be improved. I like the idea of providing a default print function to the MOI status codes. At least you then see what the numeric codes mean.

dirkschumacher commented 2 years ago

Fixed in the most recent Github version of https://github.com/r-opt/MOI