Example #1
0
        public MAM_HeuristicCalculator copyHeuristicCalculator()
        {
            CliqueHCalculator newCliqueHCalculator = new CliqueHCalculator();

            newCliqueHCalculator.instance = this.instance;
            newCliqueHCalculator.initialH = this.initialH;
            return(newCliqueHCalculator);
        }
Example #2
0
        /// <summary>
        /// Construct with chosen algorithms.
        /// </summary>
        public MAM_Run()
        {
            this.watch = Stopwatch.StartNew();


            // Preparing the solvers:
            solvers = new List <MAM_ISolver>();

            // FastMap Heuristic

            /*
             * //ISolver
             * MAM_ISolver MMStar_FastMapH_Makespan = new MM_Star(MM_Star.CostFunction.MakeSpan);
             * MAM_ISolver MMStar_FastMapH_SOC = new MM_Star(MM_Star.CostFunction.SOC);
             * MAM_HeuristicCalculator FastMapHCalculator = new FastMapHCalculator();
             * //MMStar_FastMapH_Makespan.SetHeuristic(FastMapHCalculator);
             * MMStar_FastMapH_SOC.SetHeuristic(FastMapHCalculator);
             */

            // Median Heuristic
            //ISolver
            MAM_ISolver             MMStar_MedianH_Makespan = new MM_Star(MM_Star.CostFunction.MakeSpan);
            MAM_ISolver             MMStar_MedianH_SOC      = new MM_Star(MM_Star.CostFunction.SOC);
            MAM_HeuristicCalculator MedianHCalculator       = new MedianHCalculator();

            MMStar_MedianH_Makespan.SetHeuristic(MedianHCalculator);
            //MMStar_MedianH_SOC.SetHeuristic(MedianHCalculator);

            // Clique Heuristic

            //ISolver
            MAM_ISolver             MMStar_CliqueH_Makespan = new MM_Star(MM_Star.CostFunction.MakeSpan);
            MAM_ISolver             MMStar_CliqueH_SOC      = new MM_Star(MM_Star.CostFunction.SOC);
            MAM_HeuristicCalculator CliqueHeuristic         = new CliqueHCalculator();

            MMStar_CliqueH_Makespan.SetHeuristic(CliqueHeuristic);
            //MMStar_CliqueH_SOC.SetHeuristic(CliqueHeuristic);


            // No Heuristic

            //ISolver
            MAM_ISolver             MMStar_ZeroH_Makespan = new MM_Star(MM_Star.CostFunction.MakeSpan);
            MAM_ISolver             MMStar_ZeroeH_SOC     = new MM_Star(MM_Star.CostFunction.SOC);
            MAM_HeuristicCalculator ZeroHeuristic         = new ZeroHCalculator();

            MMStar_ZeroH_Makespan.SetHeuristic(ZeroHeuristic);
            //MMStar_ZeroeH_SOC.SetHeuristic(ZeroHeuristic);


            //MAM_ISolver MMStar_LPH_Makespan = new MM_Star(MM_Star.CostFunction.MakeSpan);
            //MAM_HeuristicCalculator LPHCalculator = new LPHCalculator();
            //MMStar_LPH_Makespan.SetHeuristic(LPHCalculator);

            // *****  Makespan Solvers  *****
            //solvers.Add(MMStar_FastMapH_Makespan);
            //solvers.Add(MMStar_MedianH_Makespan);
            solvers.Add(MMStar_CliqueH_Makespan);
            //solvers.Add(MMStar_ZeroH_Makespan);

            // *****  SOC Solvers  *****
            //solvers.Add(MMStar_FastMapH_SOC);
            //solvers.Add(MMStar_MedianH_SOC);
            //solvers.Add(MMStar_CliqueH_SOC);
            //solvers.Add(MMStar_ZeroeH_SOC);


            outOfTimeCounters = new int[solvers.Count];
            for (int i = 0; i < outOfTimeCounters.Length; i++)
            {
                outOfTimeCounters[i] = 0;
            }

            this.plan = null;
        }