Exemple #1
0
    def run(self, path, DEBUG=False):
        painter = Painter(path, DEBUG=DEBUG)
        simulated_annealing = SimulatedAnnealing(self.coordinates,
                                                 max_interations=5000000,
                                                 alpha=0.9995,
                                                 min_temperature=0.00000001)
        solution, costs = simulated_annealing.execute()

        painter.plot_path(solution, self.coordinates)
        painter.plot_costs(costs)

        print("Best solution: {}".format(solution))
        print("Costs: {}".format(costs))