Skip to content

Should we stop computing the 2nd child or return both in GA Crossover? #133

@heidmic

Description

@heidmic

def _crossover(self, A: Solution, B: Solution, random_state: RandomState) -> Solution:
indices = random_state.choice(np.arange(len(A.genome)), size=min(self.n, len(A.genome)), replace=False)
for index in indices:
A = self._single_point(A, B, index)
B = self._single_point(B, A, index)
return A

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions