Exemplo n.º 1
0
        public void run()
        {
            string outputFileName          = InstanceName + ".csv";
            var    qapDataReader           = new QapDataFileReader();
            QapSolutionBenchmark benchmark = new QapSolutionBenchmark();
            var data            = qapDataReader.ReadData(@"../AlgBattle/Data/BaseData/" + InstanceName + ".dat");
            var optimalSolution = qapDataReader.ReadSolution(@"../AlgBattle/Data/BaseData/" + InstanceName + ".sln");

            Console.WriteLine("Start processing");
            QapSimpleGreedySolver hSolver = new QapSimpleGreedySolver(data);

            RunSolver(hSolver, data, benchmark, optimalSolution, "efficiency_heuristic_" + outputFileName);
            Console.WriteLine("Heuristic done");
            QapRandomSolver rSolver = new QapRandomSolver(data);

            RunSolver(rSolver, data, benchmark, optimalSolution, "efficiency_random_" + outputFileName);
            Console.WriteLine("Random done");
            QapSteepestLocalSolver sSolver = new QapSteepestLocalSolver(data);

            RunSolver(sSolver, data, benchmark, optimalSolution, "efficiency_steepest_" + outputFileName);
            Console.WriteLine("Steepest done");
            QapGreedyLocalSolver gSolver = new QapGreedyLocalSolver(data);

            RunSolver(gSolver, data, benchmark, optimalSolution, "efficiency_greedy_" + outputFileName);
            Console.WriteLine("greedy done");
            QapAnnealingSolver aSolver = new QapAnnealingSolver(data);

            RunSolver(aSolver, data, benchmark, optimalSolution, "efficiency_annealing_" + outputFileName);
            Console.WriteLine("annealing done");
            QapTabuSolver tSolver = new QapTabuSolver(data);

            RunSolver(tSolver, data, benchmark, optimalSolution, "efficiency_tabu_" + outputFileName);
            Console.WriteLine("tabu done");
        }
Exemplo n.º 2
0
        public void run()
        {
            string outputFileName          = InstanceName + ".csv";
            var    qapDataReader           = new QapDataFileReader();
            QapSolutionBenchmark benchmark = new QapSolutionBenchmark();
            var data            = qapDataReader.ReadData(@"../AlgBattle/Data/BaseData/" + InstanceName + ".dat");
            var optimalSolution = qapDataReader.ReadSolution(@"../AlgBattle/Data/BaseData/" + InstanceName + ".sln");
            //QapSteepestLocalSolver sSolver = new QapSteepestLocalSolver(data);
            //runSolver(sSolver, data, benchmark, optimalSolution, "firstVsLastsResult_steepest_" + outputFileName);
            //QapGreedyLocalSolver gSolver = new QapGreedyLocalSolver(data);
            //runSolver(gSolver, data, benchmark, optimalSolution, "firstVsLastsResult_greedy_" + outputFileName);
            //QapAnnealingSolver aSolver = new QapAnnealingSolver(data);
            //runSolver(aSolver, data, benchmark, optimalSolution, "firstVsLastsResult_annealing_" + outputFileName);
            QapTabuSolver tSolver = new QapTabuSolver(data);

            runSolver(tSolver, data, benchmark, optimalSolution, "firstVsLastsResult_tabu_" + outputFileName);
        }