public void Start(string inputFile, string outputFile, int timeLimit)
 {
     TwoSPInstance instance = new TwoSPInstance(inputFile);
     int[] lowerBounds = new int[instance.NumberItems];
     int[] upperBounds = new int[instance.NumberItems];
     for (int i = 0; i < instance.NumberItems; i++) {
         lowerBounds[i] = 0;
         upperBounds[i] = instance.NumberItems - 1;
     }
     DiscreteILS ils = new DiscreteILSBL2OptFirst42SP(instance, restartIterations, perturbations, lowerBounds, upperBounds);
     ils.Run(timeLimit - timePenalty);
     int[,] coordinates = TwoSPUtils.BLCoordinates(instance, ils.BestSolution);
     TwoSPSolution solution = new TwoSPSolution(instance, coordinates);
     solution.Write(outputFile);
 }
示例#2
0
        public void Start(string inputFile, string outputFile, int timeLimit)
        {
            TwoSPInstance instance = new TwoSPInstance(inputFile);

            int[] lowerBounds = new int[instance.NumberItems];
            int[] upperBounds = new int[instance.NumberItems];
            for (int i = 0; i < instance.NumberItems; i++)
            {
                lowerBounds[i] = 0;
                upperBounds[i] = instance.NumberItems - 1;
            }
            DiscreteILS ils = new DiscreteILSBL2OptFirst42SP(instance, restartIterations, perturbations, lowerBounds, upperBounds);

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

            solution.Write(outputFile);
        }