-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to set Integer options to infinity #25
Comments
What parameter are you trying to set to |
SolutionLimit using JuMP. |
E.g.
fails with
|
Just to note that there do exist integer parameters which are not set to Infinity by default but which should be able to, e.g. CutPasses. |
Ah I see, OK. |
Ahah, |
So that is fairly easy to fix, we can just create another method that takes floating point arguments, checks for a number bigger than |
That seems a bit messy on our side. Maybe just export GRB_MAXINT? |
Hello from the future! I've copy-pasted the code in the notebook above for the lazy constraints version, including test data. The only changes I've made are to update it to use current JuMP conventions around setting constraints etc (@constraint instead of @addConstraint etc) and current notation for sums (sum( for ) instead of sum{ , }), and to use Gurobi as the solver. solve(masterProblemModel) returns the following error message:
I'm having trouble identifying the place where set_int_param! is called with a Float argument instead of an Integer, so I'm not quite sure why this is happening but it seems that it should not be an available option within the Gurobi wrapper. It looks like the commit referencing this issue was never merged into the master file, which might be why it is still a problem. Any advice for how to work around this problem or fix it would be greatly appreciated! thanks |
This error occurs because the Gurobi model is being initialized with some parameter that only takes integers, but is being set to a float. In my case, it sufficed to set it to a sufficiently large integer; I don't think there is a solution in Julia for if you really need Inf. In your case, there are only two cases where the Model() function is called, so it was easy to check. Try changing this line:
to Presolve=0 http://www.gurobi.com/documentation/8.0/refman/presolve.html#parameter:Presolve |
Ah, such a simple solution - Thanks so much for your speedy help. It didn't occur to me that the 'int_param' in question was one that I had set in my own code. I changed it per your suggestion and everything ran perfectly. Excellent! |
Because Inf is floating point, this code in grb_params.jl fails when trying to set something in GRB_INT_PARAMS to infinity.
The text was updated successfully, but these errors were encountered: