Skip to content

Commit

Permalink
error in brkga pymoo implementation #499
Browse files Browse the repository at this point in the history
  • Loading branch information
blankjul committed Nov 17, 2023
1 parent 51418b1 commit 1607a8d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pymoo/algorithms/soo/nonconvex/brkga.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from pymoo.operators.crossover.binx import BinomialCrossover
from pymoo.operators.mutation.nom import NoMutation
from pymoo.operators.sampling.rnd import FloatRandomSampling
from pymoo.operators.selection.rnd import RandomSelection
from pymoo.termination.default import DefaultSingleObjectiveTermination
from pymoo.util.display.single import SingleObjectiveOutput
from pymoo.util.nds.non_dominated_sorting import NonDominatedSorting
Expand Down Expand Up @@ -60,8 +59,8 @@ class EliteBiasedSelection(Selection):

def _do(self, problem, pop, n_select, n_parents, **kwargs):
_type = pop.get("type")
elites = np.where(_type == "elite")[0]
non_elites = np.where(_type == "non_elite")[0]
elites = np.where(_type == "elite")[0].astype(int)
non_elites = np.where(_type == "non_elite")[0].astype(int)

# if through duplicate elimination no non-elites exist
if len(non_elites) == 0:
Expand Down

0 comments on commit 1607a8d

Please sign in to comment.