Open discosultan opened 4 years ago
I couldn't find any reason. Actually it behaves slower (without intensive tests nor digging deeper) than just including the first gen in the function.
I haven't realized the probability of change for each gen follows a pseudonormal distribution. couldn't find notes for fixing it but probably just replacing the random.randint with a normal complementary random function will solve it.
anyway, please create the pull request
I'm curious as to why the
cxTwoPoint
function does not perform crossover on the first attribute of both individuals. More specifically, why isn't line 50 written ascxpoint1 = random.randint(0, size)
instead?https://github.com/DEAP/deap/blob/454b4f65a9c944ea2c90b38a75d384cddf524220/deap/tools/crossover.py#L49-L58