seallard / walker

NEAT
MIT License
0 stars 0 forks source link

Best solution removed #75

Closed seallard closed 3 years ago

seallard commented 3 years ago

Sometimes, the best solution found is deleted. Maybe: assigned a large number of offspring which under performs? But the species leader should always be copied into the new population. Maybe: species not sorted correctly? Or wrong leader? Or leader is not copied?

seallard commented 3 years ago

It is not due to interspecies mating (the best fitness observed still decreases sometimes when it is disabled). Not due to stagnation either. The best species might stagnate -> removed. But that is not the case here.

seallard commented 3 years ago

Got it! The breeder mutated the state of genome link weights when crossover was done using averaging:

    def average_link(self, link1, link2):
        new_weight = (link1.weight + link2.weight)/2
        link1.weight = new_weight
        return link1

Why side-effects, why... So when the species leader was crossed with another genome, the weights of its links were changed.