public void RunTest_KoTS()
        {
            var competitors = Helpers.CompetitorListHelper.GetStandardCompetitors(8);

            TournamentStrategy tournamentStrategy = new KoTS(2);
            MatchStrategy matchStrategy = new SimpleRandomMs();

            var study = new Study(tournamentStrategy, matchStrategy, false);
            study.Run(competitors, _numberOfTournamentIterations);

            DisplayTestResults(tournamentStrategy, matchStrategy, study);
        }
        public void RunTest_RrTS_1()
        {
            var competitors = Helpers.CompetitorListHelper.GetCompetitorsWithRandomizedSeeds(8);

            TournamentStrategy tournamentStrategy = new RrTS(1, 1);
            MatchStrategy matchStrategy = new SimpleRandomMs();

            Study study = new Study(tournamentStrategy, matchStrategy, false);
            study.Run(competitors, _numberOfTournamentIterations, true);

            DisplayTestResults(tournamentStrategy, matchStrategy, study);
        }
        public void RunTest_RrKoSfPfFiRrTS_ReferenceFormat()
        {
            var competitors = Helpers.CompetitorListHelper.GetStandardCompetitors(8);

            TournamentStrategy tournamentStrategy = new RrKoSfPfFiRrTS(2.0, 2, 2, 2, 2.0);
            MatchStrategy matchStrategy = new SimpleRandomMs();

            Study study = new Study(tournamentStrategy, matchStrategy, false);
            study.Run(competitors, _numberOfTournamentIterations);

            DisplayTestResults(tournamentStrategy, matchStrategy, study);
        }
示例#4
0
        public void StudyIterateCompetitors_Rr_1_FirstTo2_CompetitorNumberSensitivity()
        {
            for (int i = 2; i <= _numberOfCompetitors; i++)
            {
                List<Competitor> competitors = Helpers.CompetitorListHelper.GetEvenlySpacedCompetitors(i);

                TournamentStrategy tournamentStrategy = new RrTS(1, 2);
                MatchStrategy matchStrategy = new SimpleRandomMs();

                RunStudy(competitors, tournamentStrategy, matchStrategy);
            }
        }
        public void GenerateResultTest_MultipleRoundsPartialRound_2_5()
        {
            var trs = new RrTRS(2.5);
            MatchStrategy matchStrategy = new SimpleRandomMs();
            var competitors = Helpers.CompetitorListHelper.GetStandardCompetitors(6);

            var ranks = trs.GenerateResult(matchStrategy, competitors);

            Assert.AreEqual(36, trs.Matches.Count);
        }
示例#6
0
        public void StudyRrKo1a()
        {
            List<Competitor> competitors = Helpers.CompetitorListHelper.GetEvenlySpacedCompetitors(_numberOfCompetitors);

            TournamentStrategy tournamentStrategy = new RrKo1aTS(2, 2);
            MatchStrategy matchStrategy = new SimpleRandomMs();

            RunStudy(competitors, tournamentStrategy, matchStrategy);
        }
示例#7
0
        public void StudyIterateCompetitors_Random()
        {
            for (int i = 2; i <= _numberOfCompetitors; i++)
            {
                List<Competitor> competitors = Helpers.CompetitorListHelper.GetEvenlySpacedCompetitors(i);

                TournamentStrategy tournamentStrategy = new RandomTS();
                MatchStrategy matchStrategy = new SimpleRandomMs();

                RunStudy(competitors, tournamentStrategy, matchStrategy);
            }
        }
示例#8
0
        public void StudyRrKoSfPfFiRrTS_ReferenceFormat()
        {
            List<Competitor> competitors = Helpers.CompetitorListHelper.GetEvenlySpacedCompetitors(_numberOfCompetitors);

            TournamentStrategy tournamentStrategy = new RrKoSfPfFiRrTS(2.0, 2, 2, 2, 2.0);
            MatchStrategy matchStrategy = new SimpleRandomMs();

            RunStudy(competitors, tournamentStrategy, matchStrategy);
        }
示例#9
0
        public void StudyKo_RandomSeeding()
        {
            List<Competitor> competitors = Helpers.CompetitorListHelper.GetCompetitorsWithRandomizedSeeds(_numberOfCompetitors);

            TournamentStrategy tournamentStrategy = new KoTS(2);
            MatchStrategy matchStrategy = new SimpleRandomMs();

            RunStudy(competitors, tournamentStrategy, matchStrategy);
        }
示例#10
0
        public void StudyRr2_Dominant2In16()
        {
            var competitors = Helpers.CompetitorListHelper.GetCompetitorsWithTwoDominants_16();

            TournamentStrategy tournamentStrategy = new RrTS(2);
            MatchStrategy matchStrategy = new SimpleRandomMs();

            RunStudy(competitors, tournamentStrategy, matchStrategy);
        }
示例#11
0
        public void StudyRr_1_FirstTo2_ReasonableGuessCompetitors()
        {
            List<Competitor> competitors = Helpers.CompetitorListHelper.GetReasonableGuessCompetitors_8();

            TournamentStrategy tournamentStrategy = new RrTS(1, 2);
            MatchStrategy matchStrategy = new SimpleRandomMs();

            RunStudy(competitors, tournamentStrategy, matchStrategy);
        }
        public void RunTest_Knockout()
        {
            var competitors = Helpers.CompetitorListHelper.GetStandardCompetitors(8);

            TournamentStrategy tournamentStrategy = new KoTS(2);
            MatchStrategy matchStrategy = new SimpleRandomMs();

            var study = new Study(tournamentStrategy, matchStrategy, false);
            study.Run(competitors, _numberOfTournamentIterations);

            foreach (var competitor in competitors)
            {
                foreach (var rankFrequency in competitor.RankFrequencies.OrderByDescending(x => x.Value).ThenBy(x => x.Key))
                {
                    Assert.IsTrue(rankFrequency.Key > 0);
                }
            }
        }