Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pymoo/operators/crossover/nox.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import itertools

from pymoo.core.crossover import Crossover
from pymoo.core.population import Population

Expand All @@ -7,4 +9,4 @@ def __init__(self, *, n_parents=1, n_offsprings=1, prob=0.0, **kwargs):
super().__init__(n_parents, n_offsprings, prob, **kwargs)

def do(self, problem, pop, *args, random_state, **kwargs):
return Population.create(*[random_state.choice(parents) for parents in pop])
return Population.create(*itertools.chain.from_iterable(pop))
Loading