Exemplo n.º 1
0
        public void Test_PermutateV4_Runv3_PermutateOnSixSubject()
        {
            int expectedCount = 616872;
            var input         = new List <Slot>();

            input.AddRange(TestData.GetSlotsByName(TestData.Subjects.Hydrology));
            input.AddRange(TestData.GetSlotsByName(TestData.Subjects.StructuralAnalysisII));
            input.AddRange(TestData.GetSlotsByName(TestData.Subjects.HighwayAndTransportation));
            input.AddRange(TestData.GetSlotsByName(TestData.Subjects.FluidMechanicsII));
            input.AddRange(TestData.GetSlotsByName(TestData.Subjects.IntroductionToBuildingServices));
            var timer_ofRunV3  = Stopwatch.StartNew();
            var result_ofRunV3 = Permutator.Run_v3(input.ToArray());

            timer_ofRunV3.Stop();
            Console.WriteLine("RunV3 result : ");
            Console.WriteLine("Combination count : " + result_ofRunV3.Count);
            Console.WriteLine("Elapsed time : " + timer_ofRunV3.Elapsed.TotalMilliseconds + " ms");

            var timer_ofRunV2  = Stopwatch.StartNew();
            var result_ofRunV2 = Permutator.Run_v2_WithConsideringWeekNumber(input.ToArray());

            timer_ofRunV2.Stop();
            Console.WriteLine("RunV2 result : ");
            Console.WriteLine("Combination count : " + result_ofRunV2.Count);
            Console.WriteLine("Elapsed time : " + timer_ofRunV2.Elapsed.TotalMilliseconds + " ms");


            Assert.Pass();
        }