How do I use Cbc with JuMP 0.19?

How do I use Cbc with JuMP 0.19? The new syntax is throwing me off. All of the documentation I can find is using the old syntax.

Old Syntax
model = Model(solver=CbcSolver())

I know that GLPK with new syntax is like this:
New Syntax
model = Model(with_optimizer(GLPK.Optimizer))

But this isn’t working for Cbc:
New Syntax???
model = Model(with_optimizer(CbcSolver()))

Scratch that…I found the answer here:
https://github.com/JuliaOpt/JuMP.jl/blob/master/NEWS.md

  • Most solvers have been renamed to PackageName.Optimizer . For example, GurobiSolver() is now Gurobi.Optimizer .
  • Solvers are no longer added to a model via Model(solver = XXX(kwargs...)) . Instead use Model(with_optimizer(XXX, kwargs...)) . For example, Model(with_optimizer(Gurobi.Optimizer, OutputFlag=0)) .

I updated the README: https://github.com/JuliaOpt/Cbc.jl/pull/113

1 Like