From 49e20ad20d857a16083a6c1765de78ef226a6b3e Mon Sep 17 00:00:00 2001 From: SimpleArt <71458112+SimpleArt@users.noreply.github.com> Date: Tue, 29 Dec 2020 22:51:14 -0500 Subject: [PATCH] Simpler appending to next population since it will be sorted anyways --- src/structure/population.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/structure/population.py b/src/structure/population.py index a03b312..a1abaa1 100644 --- a/src/structure/population.py +++ b/src/structure/population.py @@ -55,16 +55,13 @@ class Population: def append_children(self, chromosome_list): - """Appends a list of chromosomes to the next population. - Appends to the front so that chromosomes with fitness - values already will stay sorted. - """ + """Appends a list of chromosomes to the next population.""" - self.next_population = [ + self.next_population += ( to_chromosome(chromosome) for chromosome in chromosome_list - ] + self.next_population + ) def add_chromosome(self, chromosome, index = None):