Change run_testing to run for my fingers sake. Also update setup.py to new version

This commit is contained in:
danielwilczak101
2020-11-17 02:49:52 -05:00
parent 260d17bf91
commit e7b0e7071c
2 changed files with 1 additions and 1 deletions

24
src/run.py Normal file
View File

@ -0,0 +1,24 @@
import EasyGA
import matplotlib.pyplot as plt
# Create the genetic algorithm
ga = EasyGA.GA()
# Create 25 chromosomes each with 10 genes and 200 generations
ga.population_size = 200
ga.chromosome_length = 10
ga.generation_goal = 150
# Evolve the genetic algorithm
ga.evolve()
# Print generation and population
ga.print_generation()
ga.print_population()
# Plot the data from the genetic algorithm
plt.figure(figsize = [6, 6])
ga.graph.highest_value_chromosome() # Change this so it doesn't make its own figure or show
plt.xlabel('My datas generations') # override the xlabel
plt.ylabel('How well the fitness is') # override the ylabel
plt.title('My GA fitness x generations') # override the title
plt.show()