Skip to content

Comments

Make NoCrossover's values configurable#1

Merged
ryantqiu merged 1 commit intomainfrom
pr-742-issue-740
Oct 1, 2025
Merged

Make NoCrossover's values configurable#1
ryantqiu merged 1 commit intomainfrom
pr-742-issue-740

Conversation

@ryantqiu
Copy link
Contributor

@ryantqiu ryantqiu commented Oct 1, 2025

Recreated from original PR: anyoptimization/pymoo#742

Resolve #740

The NoCrossover class hardcodes both n_parents and n_offsprings to 1. This makes it incompatible for MixedVariableMating which expects a crossover with n_parents and n_offsprings to be 2.

This PR allows instances of NoCrossover to be customized with arbitrary n_parents and n_offspring values.

crossover = NoCrossover(n_parents=2, n_offsprings=2)

The values default to 1, which maintains compatibility with the current use of NoCrossover.

Original PR #742 by gideonoludeyi
Original: anyoptimization/pymoo#742
@ryantqiu ryantqiu merged commit ad0103b into main Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant