davidrmiller / biosim4

Biological evolution simulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

understanding generateChildGenome

rodriguez-facundo opened this issue · comments


Hi, really nice project. Thanks for sharing it.

I was looking at the function in the title and I'm curious what it does. I thought there would be a crossover approach where a child is born with half the genes from one parent and half the genes from the other parent. But looking at that function, it seems we take only 1 parent and then we randomly insert or delete 1 connection. I don't know c++ so I might be reading the code incorrectly.

Thanks again

Hi @rodriguez-facundo , From memory, I believe the existing code works something like this: We start by copying one parent's genome, then we overwrite a random-length, random-location segment of those genes with genes from the other parent. It's a standard distribution so that on average, a child inherits equally from both parents, although at the tails of the curve, a few children inherit mostly from one of the parents.



ezoic increase your site revenue