Exemplo n.º 1
0
 public void Start(string inputFile, string outputFile, int timeLimit)
 {
     TSPInstance instance = new TSPInstance(inputFile);
     int neighborChecks = (int) Math.Ceiling(neighborChecksFactor * (instance.NumberCities * (instance.NumberCities - 1)));
     int tabuListLength = (int) Math.Ceiling(tabuListFactor * instance.NumberCities);
     DiscreteTS ts = new DiscreteTS4TSP(instance, rclTreshold, tabuListLength, neighborChecks);
     ts.Run(timeLimit - timePenalty);
     TSPSolution solution = new TSPSolution(instance, ts.BestSolution);
     solution.Write(outputFile);
 }
Exemplo n.º 2
0
        public void Start(string inputFile, string outputFile, int timeLimit)
        {
            TSPInstance instance       = new TSPInstance(inputFile);
            int         neighborChecks = (int)Math.Ceiling(neighborChecksFactor * (instance.NumberCities * (instance.NumberCities - 1)));
            int         tabuListLength = (int)Math.Ceiling(tabuListFactor * instance.NumberCities);
            DiscreteTS  ts             = new DiscreteTS4TSP(instance, rclTreshold, tabuListLength, neighborChecks);

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

            solution.Write(outputFile);
        }