Juliapro 1.0 JuMP版本问题


#1

julia> M = Model(solver = GurobiSolver(TimeLimit=7200))

ERROR: The solver= keyword is no longer available in JuMP 0.19 and later. See the JuMP documentation (http://www.juliaopt.org/JuMP.jl/latest/) for latest syntax.Stacktrace: [1] #Model#4(::MathOptInterface.Utilities.CachingOptimizerMode, ::GurobiSolver, ::Type) at C:\Users\11854.juliapro\JuliaPro_v1.0.3.2\packages\JuMP\jnmGG\src\JuMP.jl:188 [2] (::getfield(Core, Symbol("#kw#Type")))(::NamedTuple{(:solver,),Tuple{GurobiSolver}}, ::Type{Model}) at.\none:0 [3] top-level scope at none:0

问题说solver 对JuMP 0.19 及以上版本不适应,所以这行代码就跑不同,想问问各位有没有遇到过类似问题,希望能提供解决方案,谢谢1


#2

可以看下文档,刚发布的JuMP的这个接口换了:
m = Model(with_optimizer(Gurobi.Optimizer))
optimize!(m)