Skip to content

Comments

Make NoCrossover's values configurable#742

Merged
blankjul merged 1 commit intoanyoptimization:mainfrom
gideonoludeyi:issue-740
Jul 15, 2025
Merged

Make NoCrossover's values configurable#742
blankjul merged 1 commit intoanyoptimization:mainfrom
gideonoludeyi:issue-740

Conversation

@gideonoludeyi
Copy link
Contributor

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.

@blankjul blankjul merged commit 97ab230 into anyoptimization:main Jul 15, 2025
4 of 5 checks passed
@blankjul
Copy link
Collaborator

good idea and quick fix. thanks!

@blankjul blankjul self-assigned this Jul 15, 2025
@gideonoludeyi gideonoludeyi deleted the issue-740 branch July 15, 2025 02:51
@oxinabox
Copy link

is this enough to make this work?
I tried this and ended up with other issues with it not producing enough outputs.
though i do not have a MWE

ryantqiu pushed a commit to snorkel-marlin-repos/pymoo_92955d03 that referenced this pull request Oct 1, 2025
Original PR #742 by gideonoludeyi
Original: anyoptimization/pymoo#742
ryantqiu added a commit to snorkel-marlin-repos/pymoo_92955d03 that referenced this pull request Oct 1, 2025
AnonymeMeow pushed a commit to AnonymeMeow/pymoo-backport that referenced this pull request Nov 4, 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.

NoCrossover hardcodes n_parents and n_offspring as 1, but MixedVariableMating requires it to be 2

3 participants