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

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

            solution.Write(outputFile);
        }