pygenetics/ga_core.py
def __determine_best_member(self):
        '''Private method: determines if any current population members have a
        fitness score better than the current best
        '''

        if self.__num_processes > 1:
            members = [m.get() for m in self.__members]
        else:
            members = self.__members

        if self.__best_fitness is None:
            self.__best_fitness = members[0].fitness_score
            self.__best_cost_fn_val = members[0].cost_fn_val
            self.__best_parameters = {}
            for p in self.__parameters:
                self.__best_parameters[p.name] = members[0].parameters[p.name]

        for m_id, member in enumerate(members):
            if member.fitness_score > self.__best_fitness:
                self.__best_fitness = member.fitness_score
                self.__best_cost_fn_val = member.cost_fn_val
                self.__best_parameters = {}
                for p in self.__parameters:
                    self.__best_parameters[p.name] = member.parameters[p.name]
def __determine_best_member(self):
        '''Private method: determines if any current population members have a
        fitness score better than the current best
        '''

        if self.__num_processes > 1:
            members = [m.get() for m in self.__members]
        else:
            members = self.__members

        if self.__best_fitness is None:
            self.__best_fitness = members[0].fitness_score
            self.__best_cost_fn_val = members[0].cost_fn_val
            self.__best_parameters = {}
            for p in self.__parameters:
                self.__best_parameters[p.name] = members[0].parameters[p.name]

        for m_id, member in enumerate(members):
            if member.fitness_score > self.__best_fitness:
                self.__best_fitness = member.fitness_score
                self.__best_cost_fn_val = member.cost_fn_val
                self.__best_parameters = {}
                for p in self.__parameters:
                    self.__best_parameters[p.name] = member.parameters[p.name]
Private method: determines if any current population members have a
        fitness score better than the current best