Skip to content

Commit

Permalink
Fix division by zero from hyperplane. (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
muazhari authored Jul 15, 2024
1 parent cb3f116 commit 0922b11
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pymoo/algorithms/moo/age.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def normalize(front, extreme):

try:
hyperplane = np.linalg.solve(front[extreme], np.ones(n))
if any(np.isnan(hyperplane)) or any(np.isinf(hyperplane)) or any(hyperplane < 0):
if any(np.isnan(hyperplane)) or any(np.isinf(hyperplane)) or any(hyperplane <= 0):
normalization = np.max(front, axis=0)
else:
normalization = 1. / hyperplane
Expand All @@ -300,4 +300,5 @@ def normalize(front, extreme):

return front, normalization


parse_doc_string(AGEMOEA.__init__)

0 comments on commit 0922b11

Please sign in to comment.