Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Vetlets05 committed Nov 15, 2024
1 parent d392e11 commit 546ad0b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@ def main(args):

min_fitnesses, avg_fitnesses, best_fitnesses = [], [], []

config_instance = Config(cores=args.cores)

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)
from_generation = generation_nums[-1] + 1 if generation_nums else 0
neat.config = config_instance
else:
neat = NEAT(Config())
neat = NEAT(config_instance)
neat.initiate_genomes()
from_generation = 0

Expand Down Expand Up @@ -155,6 +157,7 @@ def command_line_interface():
# Train command (runs main())
train_parser = subparsers.add_parser('train', help="Run the training process")
train_parser.add_argument('-g', '--n_generations', type=int, default=-1, help="The number of generations to train for")
train_parser.add_argument('-c', '--cores', type=int, default=-1, help="Number of cores that is used in training. Defaults to the max amount of cores available.")

graph_parser = subparsers.add_parser('graph', help="Graph the fitness data")

Expand Down Expand Up @@ -183,4 +186,4 @@ def command_line_interface():
parser.print_help()

if __name__ == "__main__":
command_line_interface()
command_line_interface()

0 comments on commit 546ad0b

Please sign in to comment.