Ejemplo n.º 1
0
 public void Start(string fileInput, string fileOutput, int timeLimit)
 {
     TSPInstance instance = new TSPInstance(fileInput);
     int levelLength = (int) Math.Ceiling(levelLengthFactor * (instance.NumberCities * (instance.NumberCities - 1)));
     DiscreteSA sa = new DiscreteSA4TSP(instance, initialSolutions, levelLength, tempReduction);
     sa.Run(timeLimit - timePenalty);
     TSPSolution solution = new TSPSolution(instance, sa.BestSolution);
     solution.Write(fileOutput);
 }
Ejemplo n.º 2
0
        public void Start(string fileInput, string fileOutput, int timeLimit)
        {
            TSPInstance instance    = new TSPInstance(fileInput);
            int         levelLength = (int)Math.Ceiling(levelLengthFactor * (instance.NumberCities * (instance.NumberCities - 1)));
            DiscreteSA  sa          = new DiscreteSA4TSP(instance, initialSolutions, levelLength, tempReduction);

            sa.Run(timeLimit - timePenalty);
            TSPSolution solution = new TSPSolution(instance, sa.BestSolution);

            solution.Write(fileOutput);
        }