Skip to content

Instantly share code, notes, and snippets.

@dariocazzani
Created September 1, 2017 18:51
Show Gist options
  • Save dariocazzani/62c4126b9f03240dc9789d2101c79a9a to your computer and use it in GitHub Desktop.
Save dariocazzani/62c4126b9f03240dc9789d2101c79a9a to your computer and use it in GitHub Desktop.
Genetic Algorithm Engine
def run(self):
now = time.time()
try:
for i in range(self.iterations):
self.__produce_next_gen()
self.__mutation()
except KeyboardInterrupt:
print('Quitting...')
run_time = time.time() - now
print('Run time: {:.2f}'.format(run_time))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment