Exemple #1
0
                                        for seed in SEEDS:
                                            random.seed(seed)

                                            seed_path = "%s/%d" % (mutation_probs_path, seed)
                                            make_dir(seed_path)
                                            if os.path.isfile(seed_path + "/.done"):
                                                continue

                                            best_list = []
                                            avg_list = []
                                            worst_list = []
                                            stddev_list = []

                                            start = time.time()
                                            population = Population.new(config.POPULATION_SIZE, config.REPRESENTATION)
                                            for i in xrange(1, MAX_ITERATIONS + 1):
                                                population.evolve()

                                                stats = population.getStatistics()

                                                best_list.append(stats[0])
                                                avg_list.append(stats[1])
                                                worst_list.append(stats[2])
                                                stddev_list.append(stats[3])

                                                if i in ITERATIONS:
                                                    final_path = "%s/%d" % (seed_path, i)
                                                    best = population.getBest().getPoints()

                                                    make_dir(final_path)