Updated Implementation Framework

Updated to cover changes made by Dan to Master regarding general design changes

Also added remove_two_worst survivor selection method
This commit is contained in:
RyleyGG
2020-10-05 20:46:25 -04:00
parent e05aa7f62b
commit 665062fdf1
24 changed files with 133 additions and 126 deletions

View File

@ -0,0 +1,16 @@
class Fitness_Examples:
"""Fitness function examples used"""
def is_it_5(self, chromosome):
"""A very simple case test function - If the chromosomes gene value is a 5 add one
to the chromosomes overall fitness value."""
# Overall fitness value
fitness = 0
# For each gene in the chromosome
for gene in chromosome.gene_list:
# Check if its value = 5
if(gene.value == 5):
# If its value is 5 then add one to
# the overal fitness of the chromosome.
fitness += 1
return fitness