@@ -25,7 +25,8 @@ function test_filter_nondominated()
2525 x = Dict {MOI.VariableIndex,Float64} ()
2626 solutions = [MOA. SolutionPoint (x, [0 , 1 ]), MOA. SolutionPoint (x, [1 , 0 ])]
2727 @test MOA. filter_nondominated (MOI. MIN_SENSE, solutions) == solutions
28- @test MOA. filter_nondominated (MOI. MAX_SENSE, solutions) == solutions
28+ @test MOA. filter_nondominated (MOI. MAX_SENSE, solutions) ==
29+ reverse (solutions)
2930 return
3031end
3132
@@ -34,7 +35,7 @@ function test_filter_nondominated_sort_in_order()
3435 solutions = [MOA. SolutionPoint (x, [0 , 1 ]), MOA. SolutionPoint (x, [1 , 0 ])]
3536 r_solutions = reverse (solutions)
3637 @test MOA. filter_nondominated (MOI. MIN_SENSE, r_solutions) == solutions
37- @test MOA. filter_nondominated (MOI. MAX_SENSE, r_solutions) == solutions
38+ @test MOA. filter_nondominated (MOI. MAX_SENSE, r_solutions) == r_solutions
3839 return
3940end
4041
@@ -55,7 +56,7 @@ function test_filter_nondominated_weakly_dominated()
5556 MOA. SolutionPoint (x, [1 , 0 ]),
5657 ]
5758 @test MOA. filter_nondominated (MOI. MIN_SENSE, solutions) == solutions[[1 , 3 ]]
58- @test MOA. filter_nondominated (MOI. MAX_SENSE, solutions) == solutions[[2 , 3 ]]
59+ @test MOA. filter_nondominated (MOI. MAX_SENSE, solutions) == solutions[[3 , 2 ]]
5960 solutions = [
6061 MOA. SolutionPoint (x, [0 , 1 ]),
6162 MOA. SolutionPoint (x, [0.5 , 1 ]),
@@ -67,7 +68,7 @@ function test_filter_nondominated_weakly_dominated()
6768 @test MOA. filter_nondominated (MOI. MIN_SENSE, solutions) ==
6869 solutions[[1 , 4 , 6 ]]
6970 @test MOA. filter_nondominated (MOI. MAX_SENSE, solutions) ==
70- solutions[[3 , 5 , 6 ]]
71+ solutions[[6 , 5 , 3 ]]
7172 return
7273end
7374
@@ -82,7 +83,7 @@ function test_filter_nondominated_knapsack()
8283 ]
8384 result = solutions[[1 , 3 , 4 ]]
8485 @test MOA. filter_nondominated (MOI. MIN_SENSE, solutions) == result
85- @test MOA. filter_nondominated (MOI. MAX_SENSE, solutions) == result
86+ @test MOA. filter_nondominated (MOI. MAX_SENSE, solutions) == reverse ( result)
8687 return
8788end
8889
@@ -115,7 +116,7 @@ function test_filter_epsilon()
115116 solutions =
116117 [MOA. SolutionPoint (x, [1 , 1 + 9e-5 ]), MOA. SolutionPoint (x, [2 , 1 ])]
117118 new_solutions = MOA. filter_nondominated (MOI. MAX_SENSE, copy (solutions))
118- @test new_solutions == solutions
119+ @test new_solutions == reverse ( solutions)
119120 solutions =
120121 [MOA. SolutionPoint (x, [- 1 , - 1 - 1e-6 ]), MOA. SolutionPoint (x, [- 2 , - 1 ])]
121122 new_solutions = MOA. filter_nondominated (MOI. MIN_SENSE, copy (solutions))
0 commit comments