retrieving Solution status in python
AnsweredHi,
I am solving multiple models in a loop, and sometimes some of them might not have a feasible solution and python yields the error:
RuntimeError: The model is unsolved or no solution is obtained.
I want to avoid stopping the loop by this error, and instead retrieve the status variable so that I can do some changes and my loop (next models) keeps running.
Amal
0
-
Please note that I am using the API gurobipy.
0 -
Hi Amal,
generally, the model status in Python can be retrieved by calling:
model.status
An overview of the model statuses can be seen here.
Hope this helps.
Best regards
Jonasz0
Please sign in to leave a comment.
Comments
2 comments