From eaa90ecd2a01c45b9b6c46e6aa92992e81815175 Mon Sep 17 00:00:00 2001 From: danielwilczak101 <44122838+danielwilczak101@users.noreply.github.com> Date: Wed, 23 Sep 2020 20:29:50 -0400 Subject: [PATCH] Fixed to explain --- src/run_testing.py | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/src/run_testing.py b/src/run_testing.py index fa51016..7d9db70 100644 --- a/src/run_testing.py +++ b/src/run_testing.py @@ -4,30 +4,14 @@ import EasyGA # Create the Genetic algorithm ga = EasyGA.GA() +# Makes a new gene +new_gene = ga.make_gene("HelloWorld") +# Makes a chromosome to store genes in +new_chromosome = ga.make_chromosome() +# Makes a Population to store chromosomes in +new_population = ga.make_population() -def user_initialize(): - - population_size = 1 - chromosome_length = 3 - - population = ga.make_population() - # Fill the population with chromosomes - for i in range(population_size): - chromosome = ga.make_chromosome() - #Fill the Chromosome with genes - for j in range(chromosome_length): - chromosome.add_gene(ga.make_gene("hello")) - population.add_chromosome(chromosome) - return population - - -# Start the population -ga.initialization_impl = user_initialize() - -#make gene -new_gene = ga.make_gene("Hello") -print(new_gene.get_value()) -print(new_gene.get_fitness()) +ga.initialize() print(ga.population)