Skip to content

Commit

Permalink
Fix bugs in comparator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnebro committed Sep 2, 2024
1 parent 1facc46 commit 16e6f99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jmetal/util/comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def compare(self, solution1: Solution, solution2: Solution):
def __dominance_test(self, solution1: Solution, solution2: Solution):
best_is_one = False
best_is_two = False
for i in range(solution1.number_of_objectives):
for i in range(len(solution1.objectives)):
value1 = math.floor(solution1.objectives[i] / self.epsilon)
value2 = math.floor(solution2.objectives[i] / self.epsilon)

Expand All @@ -256,7 +256,7 @@ def __dominance_test(self, solution1: Solution, solution2: Solution):
dist1 = 0.0
dist2 = 0.0

for i in range(solution1.number_of_objectives):
for i in range(len(solution1.objectives)):
index1 = math.floor(solution1.objectives[i] / self.epsilon)
index2 = math.floor(solution2.objectives[i] / self.epsilon)

Expand Down

0 comments on commit 16e6f99

Please sign in to comment.