Skip to content

Commit

Permalink
Parameter fix related to Progresively interactive NSGA-II #634
Browse files Browse the repository at this point in the history
  • Loading branch information
blankjul committed Aug 25, 2024
1 parent b35626e commit 5a2bd2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 2 additions & 5 deletions pymoo/util/nds/fast_non_dominated_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@


def fast_non_dominated_sort(F, dominator=Dominator(), **kwargs):

if "dominator" in kwargs:
if "dominator" in kwargs:
M = Dominator.calc_domination_matrix(F)
else:
else:
M = dominator.calc_domination_matrix(F)


# calculate the dominance matrix
n = M.shape[0]

Expand Down Expand Up @@ -70,4 +68,3 @@ def fast_non_dominated_sort(F, dominator=Dominator(), **kwargs):
current_front = next_front

return fronts

5 changes: 2 additions & 3 deletions pymoo/util/nds/non_dominated_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@

class NonDominatedSorting:

def __init__(self, epsilon=None, method="fast_non_dominated_sort", dominator=Dominator()) -> None:
def __init__(self, epsilon=None, method="fast_non_dominated_sort") -> None:
super().__init__()
self.epsilon = epsilon
self.method = method
self.dominator = dominator

def do(self, F, return_rank=False, only_non_dominated_front=False, n_stop_if_ranked=None, **kwargs):
F = F.astype(float)
Expand All @@ -24,7 +23,7 @@ def do(self, F, return_rank=False, only_non_dominated_front=False, n_stop_if_ran
if self.epsilon is not None:
kwargs["epsilon"] = float(self.epsilon)

fronts = func(F, **dict(kwargs, dominator=self.dominator))
fronts = func(F, **kwargs)

# convert to numpy array for each front and filter by n_stop_if_ranked if desired
_fronts = []
Expand Down

0 comments on commit 5a2bd2a

Please sign in to comment.