Hi @Caroline, welcome to the forum 
The first answer is that you can set the MOA.ObjectivePriority attribute for each objective index.
julia> using JuMP
julia> using Gurobi
julia> import MultiObjectiveAlgorithms as MOA
julia> begin
model = Model(() -> MOA.Optimizer(Gurobi.Optimizer))
@variable(model, x >= 0)
@variable(model, y >= 0)
@constraint(model, x + y <= 10)
@objective(model, Max, [x+5, y])
set_attribute(model, MOA.Algorithm(), MOA.Hierarchical())
set_attribute(model, MOA.ObjectivePriority(1), 1)
set_attribute(model, MOA.ObjectivePriority(2), 2)
optimize!(model)
end
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 722777
WLS license 722777 - registered to JuMP Development
----------------------------------------------
MultiObjectiveAlgorithms.jl
----------------------------------------------
Algorithm: Hierarchical
----------------------------------------------
solve # Obj. 1 Obj. 2 Time
----------------------------------------------
1 -5.00000e+00 -1.00000e+01 1.01781e-03
2 -5.00000e+00 -1.00000e+01 1.44792e-03
----------------------------------------------
termination_status: OPTIMAL
result_count: 1
Total solve time: 1.79482e-03
Time spent in subproblems: 5.06878e-04 (28%)
Number of subproblems: 4
----------------------------------------------
julia> value(x)
0.0
julia> value(y)
10.0
julia> set_attribute(model, MOA.ObjectivePriority(1), 3)
julia> optimize!(model)
----------------------------------------------
MultiObjectiveAlgorithms.jl
----------------------------------------------
Algorithm: Hierarchical
----------------------------------------------
solve # Obj. 1 Obj. 2 Time
----------------------------------------------
1 -1.50000e+01 -0.00000e+00 1.71185e-03
2 -1.50000e+01 -0.00000e+00 2.51889e-03
----------------------------------------------
termination_status: OPTIMAL
result_count: 1
Total solve time: 3.50690e-03
Time spent in subproblems: 1.58787e-03 (45%)
Number of subproblems: 4
----------------------------------------------
julia> value(x)
10.0
julia> value(y)
0.0
Objectives are minimised in order of decreasing priority. Bigger is more important.
But the hierarchical algorithm is really useful only if you want to blend different objectives together. If you just want the lexicographic solution, then do:
julia> using JuMP
julia> using Gurobi
julia> import MultiObjectiveAlgorithms as MOA
julia> begin
model = Model(() -> MOA.Optimizer(Gurobi.Optimizer))
@variable(model, x >= 0)
@variable(model, y >= 0)
@constraint(model, x + y <= 10)
@objective(model, Max, [x+5, y])
set_attribute(model, MOA.Algorithm(), MOA.Lexicographic())
set_attribute(model, MOA.LexicographicAllPermutations(), false)
optimize!(model)
end
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 722777
WLS license 722777 - registered to JuMP Development
----------------------------------------------
MultiObjectiveAlgorithms.jl
----------------------------------------------
Algorithm: Lexicographic
----------------------------------------------
solve # Obj. 1 Obj. 2 Time
----------------------------------------------
1 1.50000e+01 0.00000e+00 1.93028e-02
2 1.50000e+01 0.00000e+00 1.97539e-02
----------------------------------------------
termination_status: OPTIMAL
result_count: 1
Total solve time: 2.01530e-02
Time spent in subproblems: 6.46830e-04 (3%)
Number of subproblems: 4
----------------------------------------------
julia> value(x)
10.0
julia> value(y)
0.0
The objectives are prioritised given the order that they are defined. So x+5 is more important than y.