From 425a86d285972ea911886755f2ba07b8b1202c9d Mon Sep 17 00:00:00 2001 From: NeuralNine Date: Tue, 2 Feb 2021 21:04:48 +0100 Subject: [PATCH] Fixed Alive Counter Bug --- simulation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simulation.py b/simulation.py index bdbce46..b5bf33a 100644 --- a/simulation.py +++ b/simulation.py @@ -203,14 +203,14 @@ def run_simulation(genomes, config): # Check If Car Is Still Alive # Increase Fitness If Yes And Break Loop If Not - still_alive = False + still_alive = 0 for i, car in enumerate(cars): if car.is_alive(): - still_alive = True + still_alive += 1 car.update(game_map) genomes[i][1].fitness += car.get_reward() - if still_alive == False: + if still_alive == 0: break counter += 1