PytLab / gaft

A Genetic Algorithm Framework in Python (not for production level)
http://gaft.readthedocs.io/
GNU General Public License v3.0
739 stars 218 forks source link

fitness init will be overwritten when GAEngine init #17

Closed minimada closed 6 years ago

minimada commented 6 years ago

When perform engine = GAEngine(..., fitness=fitness), the fitness function will be overwritten None at GAEngine.init line 135: self.ori_fitness, self.fitness = None, None

I think maybe you can use self.ori_fitness = None if self.fitness is None else self.fitness instead of origin code.

PytLab commented 6 years ago

Yes, you're right! I will fix this bug later or you can pull request if possible :) And I will test it and merge.