Esempio n. 1
0
 public void Start(string inputFile, string outputFile, int timeLimit)
 {
     TwoSPInstance instance = new TwoSPInstance(inputFile);
     MaxMinAntSystem aco = new MaxMinAntSystemNPS42SP(instance, numberAnts, rho, alpha, beta, maxReinit);
     // Solving the problem and writing the best solution found.
     aco.Run(timeLimit - timePenalty);
     int[,] coordinates = TwoSPUtils.NPSCoordinates(instance, aco.BestSolution);
     TwoSPSolution solution = new TwoSPSolution(instance, coordinates);
     solution.Write(outputFile);
 }
Esempio n. 2
0
        public void Start(string inputFile, string outputFile, int timeLimit)
        {
            TwoSPInstance   instance = new TwoSPInstance(inputFile);
            MaxMinAntSystem aco      = new MaxMinAntSystemNPS42SP(instance, numberAnts, rho, alpha, beta, maxReinit);

            // Solving the problem and writing the best solution found.
            aco.Run(timeLimit - timePenalty);
            int[,] coordinates = TwoSPUtils.NPSCoordinates(instance, aco.BestSolution);
            TwoSPSolution solution = new TwoSPSolution(instance, coordinates);

            solution.Write(outputFile);
        }