From c5093f35252b879ff3bb9bddc82a0e9be3e25ea5 Mon Sep 17 00:00:00 2001 From: BrianMa Date: Thu, 10 May 2018 09:21:10 +0800 Subject: [PATCH] fix init engine with fitness is not working --- gaft/engine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gaft/engine.py b/gaft/engine.py index 852c508..cf34858 100644 --- a/gaft/engine.py +++ b/gaft/engine.py @@ -132,7 +132,7 @@ def __init__(self, population, selection, crossover, mutation, self._ori_fmax, self._ori_fmin, self._ori_fmean = None, None, None # Default fitness functions. - self.ori_fitness, self.fitness = None, None + self.ori_fitness = None if self.fitness is None else self.fitness # Store current generation number. self.current_generation = -1 # Starts from 0.