Skip to content

Strange behavior of MixProbability in UniformCrossover  #125

@leshacsharp

Description

@leshacsharp

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions