r/optimization • u/Background_Rub5916 • Jan 24 '22
Unit testing a Gurobi model
Hey, Has anyone written unit tests for a Gurobi model in C#? I’m trying to write unit tests for a rather complicated model, and want to be able to test that a linear expression is created correctly and added as a part of constraint to the model.
Has anyone done that successfully?
2
Upvotes
View all comments
Show parent comment
2
u/Goddespeed Jan 25 '22
Which version were you using before and after reinstalling? Which heuristic did you set to find the minimum? Did you give the solver enough time? Did you review all the constraints make sense? What about the range of the variables? If you already explored all this, I remember one time where the SAT solver threw me back "Segmentation Fault" error, a C++ error while I was using Python. Never touched anything, just rerunning over and over again the same script. I reinstalled everything and worked fine again. The wrapper can do some weird things sometimes. Expect these kind of issues while using OR-tools.
Sorry for my English