Changes from meeting

This commit is contained in:
danielwilczak101
2020-09-30 19:33:23 -04:00
parent 625143da7d
commit 8377650c58
6 changed files with 31 additions and 22 deletions

View File

@ -1,12 +1,15 @@
class chromosome:
def __init__(self, genes = None):
"""Initialize the chromosome based on input gene list, defaulted to an empty list"""
if genes is None:
self.genes = []
else:
self.genes = genes
# The fitness of the overal chromosome
self.fitness = None
# If the chromosome has been selected then the flag would switch to true
self.selected = False
def add_gene(self, gene, index = -1):
"""Add a gene to the chromosome at the specified index, defaulted to end of the chromosome"""