anriseth / MultiJuMP.jl

MultiJuMP enables the user to easily run multiobjective optimisation problems and generate Pareto fronts.
Other
61 stars 11 forks source link

Improve objective-setting API #38

Open matbesancon opened 5 years ago

matbesancon commented 5 years ago
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