Unable to optimize using Alpine.jl

I’m havinng trouble using Alpine.jl. I know that it’s compatible with MOI now, and the new version was presented at INFORMS this year. Yet, when I try using it, I get the following error:

MethodError: no method matching initialize(::Nothing, ::Array{Symbol,1})
Closest candidates are:
  initialize(!Matched::JuMP.NLPEvaluator, ::Array{Symbol,1}) at /Users/Hassan/.julia/packages/JuMP/qhoVb/src/nlp.jl:309
  initialize(!Matched::MathOptInterface.Test.FeasibilitySenseEvaluator, ::Array{Symbol,1}) at /Users/Hassan/.julia/packages/MathOptInterface/VjkSQ/src/Test/nlp.jl:184
  initialize(!Matched::MathOptInterface.Test.HS071, ::Array{Symbol,1}) at /Users/Hassan/.julia/packages/MathOptInterface/VjkSQ/src/Test/nlp.jl:16
  ...
load!(::Alpine.Optimizer) at solver.jl:484
optimize!(::Alpine.Optimizer) at algorithm.jl:17
optimize!(::MathOptInterface.Bridges.LazyBridgeOptimizer{Alpine.Optimizer}) at bridge_optimizer.jl:264
optimize!(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}) at cachingoptimizer.jl:215
optimize!(::JuMP.Model, ::Nothing; bridge_constraints::Bool, ignore_optimize_hook::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at optimizer_interface.jl:130
optimize! at optimizer_interface.jl:106 [inlined]
optimize! at optimizer_interface.jl:106 [inlined]

It seems that it cannot launch any solvers. My code for running Alpine is

nl_solver  = optimizer_with_attributes(Ipopt.Optimizer, "print_level"=>0, "tol"=>1e-12);
mip_solver = optimizer_with_attributes(Gurobi.Optimizer, "OutputFlag"=>0, "FeasibilityTol"=>1e-6, "OptimalityTol"=>1e-8);
m = Model(optimizer_with_attributes(Alpine.Optimizer, "nlp_solver"=>nl_solver, "mip_solver"=>mip_solver, "time_limit"=>tlim, "relgap"=>gap,"loglevel" => 100));

Any help would be appreciated. Thank you.

Looking at the error it appears initialize() does not take nothing as the first parameter, at least when an array of Symbols is passed in as the second.

From the error the closest candidates are:

  initialize(!Matched::JuMP.NLPEvaluator, ::Array{Symbol,1}) at /Users/Hassan/.julia/packages/JuMP/qhoVb/src/nlp.jl:309
  initialize(!Matched::MathOptInterface.Test.FeasibilitySenseEvaluator, ::Array{Symbol,1}) at /Users/Hassan/.julia/packages/MathOptInterface/VjkSQ/src/Test/nlp.jl:184
  initialize(!Matched::MathOptInterface.Test.HS071, ::Array{Symbol,1}) at /Users/Hassan/.julia/packages/MathOptInterface/VjkSQ/src/Test/nlp.jl:16

One takes a JuMP.NLPEvaluator, the second takes a MathOptInterface.Test.FeasibilitySenseEvaluator and the third takes a MathOptInterface.Test.HS071.

You might try entering initialize( into the REPL then hit tab, that appears to show various forms of the function that may show you other arguments you could pass as the first parameter.

Please provide a “minimal working example”, MWE. Also, take a look at: Please read: make it easier to help you

1 Like