Skip to content

Mutation fails to reach genes 4-7 #35

@padillah

Description

@padillah

The following piece of code makes sure that each mutation is done both as a decrement and an increment.

mutation *= -1; // Alternate between incrementing and decrementing. if (mutation == 1) // After gene has been both incremented and decremented, move to next one. { mutatedGene = (mutatedGene + 1) % Biomorph.GENE_COUNT; }

But if the 'Biomorph.GENE_COUNT' is 8 then the 9 Biomorphs will mutate genes 0, 1, -1, 2, -2, 3, -3, and 4. It will never mutate genes -4, 5, -5, 6, -6, or 7.

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