CodeReclaimers / neat-python

Python implementation of the NEAT neuroevolution algorithm
BSD 3-Clause "New" or "Revised" License
1.41k stars 490 forks source link

Statistics #200

Open LucasColas opened 4 years ago

LucasColas commented 4 years ago

Hello when I run my code here is what I get in my console : [-1.0, 1.0, 1.0, 1.0, -1.0] [-1.0, 1.0, 1.0, -1.0, -1.0] [-1.0, -1.0, -1.0, 1.0, -1.0] [-1.0, -1.0, 1.0, 1.0, -1.0] [1.0, -1.0, 1.0, -1.0, -1.0] [-0.9999999999999994, -1.0, 1.0, 1.0, -1.0] [1.0, 1.0, 1.0, -1.0, 1.0] [1.0, 1.0, -1.0, 1.0, -1.0] [1.0, 1.0, -1.0, 1.0, -1.0] [-1.0, 1.0, -1.0, 0.0, 1.0] [-1.0, 1.0, 1.0, 1.0, -1.0] [-1.0, 1.0, 1.0, -1.0, -1.0] [1.0, -1.0, -1.0, 1.0, 1.0] [-1.0, -1.0, 1.0, 0.0, -1.0] [1.0, -1.0, -1.0, 1.0, 1.0] [-1.0, -1.0, -1.0, -1.0, -1.0] [1.0, -1.0, -1.0, -1.0, 1.0]

My code :

def run(config_path):
    max_gen = 150
    config = neat.config.Config(neat.DefaultGenome, neat.DefaultReproduction, neat.DefaultSpeciesSet,
    neat.DefaultStagnation, config_path)

    p = neat.Population(config)

    #Stats
    stats = neat.StatisticsReporter()
    p.add_reporter(neat.StdOutReporter(True))
    p.add_reporter(stats)

    winner = p.run(main, max_gen)
if __name__ == "__main__":
    local_dir = os.path.dirname(__file__)
    config_path = os.path.join(local_dir, "NeatConfig.txt")
    run(config_path)