Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior of MixProbability in UniformCrossover #125

Open
leshacsharp opened this issue May 30, 2024 · 0 comments
Open

Strange behavior of MixProbability in UniformCrossover #125

leshacsharp opened this issue May 30, 2024 · 0 comments

Comments

@leshacsharp
Copy link

Hey,

The UniformCrossover has MixProbability field for swapping genes. In the current implementation genes are swapped when the event is NOT occuried. Why not vice versa?

if (RandomizationProvider.Current.GetDouble() < MixProbability)
{
firstChild.ReplaceGene(i, firstParent.GetGene(i));
secondChild.ReplaceGene(i, secondParent.GetGene(i));
}
else
{
firstChild.ReplaceGene(i, secondParent.GetGene(i));
secondChild.ReplaceGene(i, firstParent.GetGene(i));
}

Thanks!

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

No branches or pull requests

1 participant