Skip to content

Commit

Permalink
refactor: convert to if-else one-liner
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFredrikJohnsen committed Nov 5, 2024
1 parent c2baf27 commit 07ac09c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ def main(args):
neat = load_neat(neat_name)
if neat is not None: # TODO: Add option to insert new config into NEAT object.
generation_nums, best_fitnesses, avg_fitnesses, min_fitnesses = read_fitness_file(neat_name)
if len(generation_nums) == 0:
from_generation = 0
else:
from_generation = generation_nums[-1] + 1
from_generation = generation_nums[-1] + 1 if generation_nums else 0
neat.config = config_instance
else:
neat = NEAT(config_instance)
Expand Down

0 comments on commit 07ac09c

Please sign in to comment.