Skip to content

Instantly share code, notes, and snippets.

@davidkatz
Created November 12, 2012 12:45
Show Gist options
  • Save davidkatz/4059203 to your computer and use it in GitHub Desktop.
Save davidkatz/4059203 to your computer and use it in GitHub Desktop.
for num in range(0,config.MAX_NUMBER_OF_GENERATIONS):
children = evolution_tools.make_children(survivor,config.GENERATION_SIZE)
survivor = evolution_tools.survive_selectively(children,GOAL_ORGANISM)
print str(num*config.GENERATION_SIZE) + ': ' + ''.join(survivor)
if ''.join(survivor) == ''.join(GOAL_ORGANISM):
print 'GOAL REACHED!'
print 'ORGANISMS SAMPLED: ' + str(num*config.GENERATION_SIZE)
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment