Added comments

This commit is contained in:
danielwilczak101
2020-09-21 01:58:00 -04:00
parent df1dae2964
commit 42e058b9ea

View File

@ -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())