Example #1
0
 public void Start(string inputFile, string outputFile, int timeLimit)
 {
     TwoSPInstance instance = new TwoSPInstance(inputFile);
     int neighborChecks = (int) Math.Ceiling(neighborChecksFactor * (2 * instance.NumberItems));
     int tabuListLength = (int) Math.Ceiling(tabuListFactor * instance.NumberItems);
     DiscreteTS ts = new DiscreteTSNPS42SP(instance, tabuListLength, neighborChecks);
     ts.Run(timeLimit - timePenalty);
     int[,] coordinates = TwoSPUtils.NPSCoordinates(instance, ts.BestSolution);
     TwoSPSolution solution = new TwoSPSolution(instance, coordinates);
     solution.Write(outputFile);
 }
        public void Start(string inputFile, string outputFile, int timeLimit)
        {
            TwoSPInstance instance       = new TwoSPInstance(inputFile);
            int           neighborChecks = (int)Math.Ceiling(neighborChecksFactor * (2 * instance.NumberItems));
            int           tabuListLength = (int)Math.Ceiling(tabuListFactor * instance.NumberItems);
            DiscreteTS    ts             = new DiscreteTSNPS42SP(instance, tabuListLength, neighborChecks);

            ts.Run(timeLimit - timePenalty);
            int[,] coordinates = TwoSPUtils.NPSCoordinates(instance, ts.BestSolution);
            TwoSPSolution solution = new TwoSPSolution(instance, coordinates);

            solution.Write(outputFile);
        }