Files
EasyGA/src/run_testing.py
danielwilczak101 78d63aa4aa Testing
2020-09-24 23:51:40 -04:00

17 lines
298 B
Python

import EasyGA
import random
# Create the Genetic algorithm
ga = EasyGA.GA()
def user_defined_gene():
return random.choice(["left","right","up","down"])
ga.gene_function_impl = user_defined_gene
# Creating population
ga.initialize()
# Print the current population
ga.population.print_all()