Loop through generations
This commit is contained in:
parent
c8b34af323
commit
9d2494660b
|
@ -7,7 +7,8 @@ args = args.parse_args()
|
||||||
|
|
||||||
pop = Population(args.pop)
|
pop = Population(args.pop)
|
||||||
|
|
||||||
while True:
|
for i in range(0, 5000):
|
||||||
print(pop)
|
|
||||||
input("Advance...")
|
|
||||||
pop.advance_generation()
|
pop.advance_generation()
|
||||||
|
best = pop.best_fitness()
|
||||||
|
print("Best fit:\tx:%e,\ty:%e\tf:%e" % (best.x, best.y, best.fitness()))
|
||||||
|
print("Average fit:\t%e\n" % pop.avg_fitness())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user