From 8eb436d6a5a87397f961ba02cc3a4deb4d0c7d52 Mon Sep 17 00:00:00 2001 From: danielwilczak101 <44122838+danielwilczak101@users.noreply.github.com> Date: Thu, 19 Nov 2020 01:41:01 -0500 Subject: [PATCH] Added list function to chromosome class --- src/structure/chromosome.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/structure/chromosome.py b/src/structure/chromosome.py index fa0be12..d042065 100644 --- a/src/structure/chromosome.py +++ b/src/structure/chromosome.py @@ -53,6 +53,10 @@ class Chromosome: """Set the fitness value of the chromosome""" self.fitness = fitness + def list(self): + """Returns the chromosome as a list""" + return [gene.value for gene in input_value.gene_list] + def __repr__(self): """Create a backend string of the chromosome. Ex '1, 2, 3'."""