diff --git a/examples/tuners/ga_customer_tuner/customer_tuner.py b/examples/tuners/ga_customer_tuner/customer_tuner.py index c375f666cc..16203a2e08 100644 --- a/examples/tuners/ga_customer_tuner/customer_tuner.py +++ b/examples/tuners/ga_customer_tuner/customer_tuner.py @@ -61,7 +61,8 @@ def __str__(self): def mutation(self, config=None, info=None, save_dir=None): self.result = None - self.config = config + if config is not None: + self.config = config self.config.mutation() self.restore_dir = self.save_dir self.save_dir = save_dir @@ -121,8 +122,7 @@ def receive_trial_result(self, parameter_id, parameters, reward): logger.debug(str(parameters)) logger.debug(str(reward)) - indiv = graph_loads(parameters) - indiv.result = reward + indiv = Individual(graph_loads(parameters), result=reward) self.population.append(indiv) return