From 7511429228b49784a210d2b58d75d70454296e65 Mon Sep 17 00:00:00 2001 From: SimpleArt <71458112+SimpleArt@users.noreply.github.com> Date: Thu, 19 Nov 2020 17:14:14 -0500 Subject: [PATCH] Shortened code --- src/mutation/mutation_methods.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/mutation/mutation_methods.py b/src/mutation/mutation_methods.py index a6cc483..c8b2192 100644 --- a/src/mutation/mutation_methods.py +++ b/src/mutation/mutation_methods.py @@ -68,10 +68,6 @@ class Mutation_Methods: index_one = random.randint(0, len(chromosome)-1) index_two = random.randint(0, len(chromosome)-1) - gene_one = chromosome.get_gene(index_one) - gene_two = chromosome.get_gene(index_two) - - chromosome[index_two] = gene_one - chromosome[index_one] = gene_two + chromosome[index_one], chromosome[index_two] = chromosome[index_two], chromosome[index_one] return chromosome