I took a look at the code to understand it and got a bit confused at this section, so I read the paragraph in the paper.
The paper states
There was a 75% chance that an inherited gene was disabled if it was disabled in either parent.
This doesn't mean there's a 25% chance of it being enabled if both parents are disabled. However this is what the current code does. It has to be disabled if both parents are disabled already.
if not self.enabled or not gene2.enabled:
# Override whatever was randomly inherited: 75% disabled, 25% enabled.
new_gene.enabled = random() >= 0.75
It could look like this:
if self.enabled ^ gene2.enabled:
new_gene.enabled = random() >= 0.75
I took a look at the code to understand it and got a bit confused at this section, so I read the paragraph in the paper.
The paper states
This doesn't mean there's a 25% chance of it being enabled if both parents are disabled. However this is what the current code does. It has to be disabled if both parents are disabled already.
It could look like this: