Changed example

This commit is contained in:
danielwilczak101
2020-09-27 23:25:16 -04:00
parent 1797d88c0b
commit 472c9c2379
2 changed files with 13 additions and 10 deletions

View File

@ -3,9 +3,12 @@ import random
# Create the Genetic algorithm
ga = EasyGA.GA()
ga.chromosome_length = 3
def user_gene_domain(gene_index):
"""Each gene index is assosiated to its index in the chromosome"""
chromosome = [
# Gene instructions set here
random.randrange(1,100),
random.uniform(10,5),
random.choice(["up","down"])