Comment updates

This commit is contained in:
RyleyGG
2020-09-27 17:46:17 -04:00
parent d1334090a8
commit 31f5f25c36
3 changed files with 31 additions and 15 deletions

View File

@ -4,21 +4,28 @@ def check_gene(value):
return value
class gene:
def __init__(self, value):
"""Initialize a gene with fitness of value None and the input value"""
self.fitness = None
self.value = check_gene(value)
def get_fitness(self):
"""Return fitness of the gene"""
return self.fitness
def get_value(self):
"""Return value of the gene"""
return self.value
def set_fitness(self, fitness):
"""Set fitness of the gene"""
self.fitness = fitness
def set_value(self):
"""Set value of the gene"""
self.value = value
def __repr__(self):
"""Format the repr() output value"""
return f'[{self.value}]'