Skip to content

Commit c192248

Browse files
committed
Ensure filter_nondominated is called for all algorithms
1 parent f1d87ee commit c192248

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

src/MultiObjectiveAlgorithms.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,8 @@ function _optimize!(model::Optimizer)
869869
status, solutions = optimize_multiobjective!(algorithm, model)
870870
model.termination_status = status
871871
if solutions !== nothing
872-
model.solutions = solutions
873-
_sort!(model.solutions, MOI.get(model, MOI.ObjectiveSense()))
872+
sense = MOI.get(model, MOI.ObjectiveSense())
873+
model.solutions = filter_nondominated(sense, solutions)
874874
end
875875
if !model.silent
876876
_print_footer(stdout, model)

src/algorithms/EpsilonConstraint.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,5 @@ function minimize_multiobjective!(
133133
bound = min(Y[1] - constant - ε, bound - ε)
134134
end
135135
MOI.delete(model, ci)
136-
return status, filter_nondominated(MOI.MIN_SENSE, solutions)
136+
return status, solutions
137137
end

src/algorithms/KirlikSayin.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,5 @@ function minimize_multiobjective!(algorithm::KirlikSayin, model::Optimizer)
194194
MOI.delete.(model, ε_constraints)
195195
MOI.delete(model, zₖ_constraint)
196196
end
197-
return status, filter_nondominated(MOI.MIN_SENSE, solutions)
197+
return status, solutions
198198
end

src/algorithms/Lexicographic.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ function optimize_multiobjective!(algorithm::Lexicographic, model::Optimizer)
110110
break
111111
end
112112
end
113-
sense = MOI.get(model.inner, MOI.ObjectiveSense())
114-
return status, filter_nondominated(sense, solutions)
113+
return status, solutions
115114
end
116115

117116
function _solve_in_sequence(

src/algorithms/RandomWeighting.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@ function optimize_multiobjective!(algorithm::RandomWeighting, model::Optimizer)
8181
end
8282
solutions = filter_nondominated(sense, solutions)
8383
end
84-
return MOI.OPTIMAL, filter_nondominated(sense, solutions)
84+
return MOI.OPTIMAL, solutions
8585
end

0 commit comments

Comments
 (0)