From 42e058b9eaf81a00dbe46730ecefeb2b98d6fd37 Mon Sep 17 00:00:00 2001 From: danielwilczak101 <44122838+danielwilczak101@users.noreply.github.com> Date: Mon, 21 Sep 2020 01:58:00 -0400 Subject: [PATCH] Added comments --- src/example.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/example.py b/src/example.py index 1f1ab53..343a35e 100644 --- a/src/example.py +++ b/src/example.py @@ -1,15 +1,17 @@ import random import EasyGA +# The user defined gene function def user_gene_function(): return random.randint(1, 100) +# Standard user size requirements Population_size = 10 Chromosome_length = 10 +# Create the Genetic algorithm ga = EasyGA.GA(Population_size, Chromosome_length,user_gene_function) - -# Setup the GA's population,chromosomes and genes ga.initialize() +# Looking at the first chromosome in the population print(ga.population.chromosomes[0].print_chromosome())