You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using JuMP, AmplNLWriter
x0 = 1.0 # continuous fixed variable value
m = Model(solver=BonminNLSolver())
@defVar(m, x == x0)
@defVar(m, y, Bin)
@setNLObjective(m, Min, x*y)
solve(m)
Error message:
ERROR: assertion failed: all(x->begin # /Users/Ashwin/.julia/v0.3/AmplNLWriter/src/AmplNLWriter.jl, line 195:
$(Expr(:in, :x, :([:Cont,:Bin,:Int])))
end,cat)
in setvartype! at /Users/Ashwin/.julia/v0.3/AmplNLWriter/src/AmplNLWriter.jl:195
in _buildInternalModel_nlp at /Users/Ashwin/.julia/v0.3/JuMP/src/nlp.jl:543
in buildInternalModel at /Users/Ashwin/.julia/v0.3/JuMP/src/solvers.jl:623
in solve at /Users/Ashwin/.julia/v0.3/JuMP/src/solvers.jl:39
in include at /Applications/Juno.app/Contents/Resources/app/julia/lib/julia/sys.dylib
in include_from_node1 at /Applications/Juno.app/Contents/Resources/app/julia/lib/julia/sys.dylib
in reload_path at loading.jl:152
in reload at loading.jl:85
while loading /Users/Ashwin/Documents/GitHub/Ashwin/Research/Research/MIPLaneChange/testBonminAmplSolve2.jl, in expression starting on line 10
I was able to resolve that by using the Variable() method to specify the variable category:
I think there was a fix at some point to prevent fixed variables from leaking out of JuMP, but it may have gotten broken (or never fixed in the first place?) for MINLP's. I might be wrong but I don't think any of the MINLP tests currently have any fixed variables.
Originally posted here
This piece of code gives me an assertion failure:
Error message:
I was able to resolve that by using the Variable() method to specify the variable category:
Another workaround suggested by @mlubin :
If no binary variables are involved, fixed continuous variables defined by the @defvar macro work fine. Eg:
This is not a problem when I call Bonmin via CoinOptServices. Using BonminNLSolver() or CouenneNLSolver() gives the assertion failure.
The text was updated successfully, but these errors were encountered: