-
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
How can I terminate model in the callback function? #381
Comments
Please follow the example: https://github.com/jump-dev/Gurobi.jl#callbacks Here's an example calling Gurobi.jl/test/MOI/MOI_wrapper.jl Lines 1019 to 1028 in 35ec720
Note that if you are using JuMP, you need to use |
Thanks for your replying, I attach my toy example:
Then I got the error:
Looks that the error will raise even I use
in the example. Any idea to solve it? |
See #382 |
Hey,
I want to create multiple-terminating criteria in Gurobi like this example {https://support.gurobi.com/hc/en-us/articles/360047717291} in gurobipy.
I tried using
GRBterminate(model)
in callback function but an error raisedMethodError: no method matching unsafe_convert(::Type{Ptr{Nothing}}, ::UnitCommitmentModel) Closest candidates are: unsafe_convert(::Type{Ptr{Nothing}}, !Matched::Base.RefValue{T}) where T at refvalue.jl:30 unsafe_convert(::Type{Ptr{Nothing}}, !Matched::Base.RefArray{T,A,R} where R where A<:(AbstractArray{T,N} where N)) where T at refpointer.jl:90 unsafe_convert(::Type{Ptr{Nothing}}, !Matched::Base.CFunction) at c.jl:36 ...
How can I terminate model in the callback function?
Thanks!
The text was updated successfully, but these errors were encountered: