from Evolver import Evolver
from random import choice

alphabet = [chr(x) for x in range(ord('a'), ord('z'))]

def findSolution(g):
	solutions = []
	
	count = 0
	while (len(solutions) == 0 and count < 1000):
		solutions = g.Evolve()
		count += 1
	
	print "generations: ", count
	print "solutions: ", solutions
	print "population: ", g.population

g = Evolver([[choice(alphabet) for x in range(4)] for x in range(200)])
findSolution(g)

g.Mate = g.RandomPointCrossover
g.Selection = g.TournamentSelection
g.Selection_inverse = g.TournamentSelection_inverse

g = Evolver([[choice(alphabet) for x in range(4)] for x in range(200)])
findSolution(g)


