public void Start(string inputFile, string outputFile, int timeLimit)
 {
     TSPInstance instance = new TSPInstance(inputFile);
     int levelLength = (int) Math.Ceiling(levelLengthFactor * (instance.NumberCities * (instance.NumberCities - 1)));
     DiscreteHMSAwGRASP2OptBest4TSP hm = new DiscreteHMSAwGRASP2OptBest4TSP(instance, rclTreshold, graspIterations, initialSolutions, levelLength, tempReduction);
     hm.Run(timeLimit - timePenalty);
     TSPSolution solution = new TSPSolution(instance, hm.BestSolution);
     solution.Write(outputFile);
 }
Esempio n. 2
0
        public void Start(string inputFile, string outputFile, int timeLimit)
        {
            TSPInstance instance              = new TSPInstance(inputFile);
            int         levelLength           = (int)Math.Ceiling(levelLengthFactor * (instance.NumberCities * (instance.NumberCities - 1)));
            DiscreteHMSAwGRASP2OptBest4TSP hm = new DiscreteHMSAwGRASP2OptBest4TSP(instance, rclTreshold, graspIterations, initialSolutions, levelLength, tempReduction);

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

            solution.Write(outputFile);
        }