MultiJuMP.jl icon indicating copy to clipboard operation
MultiJuMP.jl copied to clipboard

Improve objective-setting API

Open matbesancon opened this issue 5 years ago • 0 comments

const exp_obj1 = @expression(mmodel, -y +0.05 * z)
const exp_obj2 = @expression(mmodel, 0.05 * y - z)
const obj1 = SingleObjective(exp_obj1)
const obj2 = SingleObjective(exp_obj2)

# setting objectives in the data
const multim = get_multidata(mmodel)
multim.objectives = [obj1, obj2]

Represents too many steps. We should have a set_objectives(::MultiData, ::Vector{SingleObjective}) and the same with set_objectives(::MultiData, ::Vector{JuMP.GenericAffExpr}) which would construct each objective from JuMP.GenericAffExpr

matbesancon avatar Apr 16 '19 08:04 matbesancon