Better UI

This commit is contained in:
Philippe Tillet
2014-10-31 18:56:33 -04:00
parent 89f3e1d211
commit 45d602bfc8
2 changed files with 78 additions and 39 deletions

View File

@@ -187,7 +187,7 @@ class GeneticOperators(object):
gen = gen + 1
best_profile = '(%s)'%','.join(map(str,self.decode(hof[0])))
best_performance = compute_perf(hof[0].fitness.values[0])
sys.stdout.write('Generation %d | Time %d | Best %d %s [ for %s ]\n'%(gen, time.time() - start_time, best_performance, perf_metric, best_profile))
sys.stdout.write('Generation %d | Time %d | Best %d %s [ for %s ]\r'%(gen, time.time() - start_time, best_performance, perf_metric, best_profile))
sys.stdout.flush()
sys.stdout.write('\n')
return self.decode(hof[0])