Beispiel #1
0
        public override bool Beats(Player[] teamA, Player[] teamB, out double winChance)
        {
            int individualWins = 0;
            int teamSize       = teamA.Length;

            for (int p = 0; p < teamSize; p++)
            {
                double chance = teamA[p].trueskill - teamB[p].trueskill > Program.beatBound ? 1 : (teamA[p].trueskill - teamB[p].trueskill < -Program.beatBound ? 0 : ELO.WinChance(teamA[p].trueskill, teamB[p].trueskill));
                if (Wins(chance))
                {
                    individualWins++;
                    //Console.WriteLine($"allied player {p} beat enemy player {p}");
                }
                else
                {
                    //Console.WriteLine($"allied player {p} lost to enemy player {p}");
                }
            }

            double relativeWins = (double)individualWins / (double)teamSize;
            //Console.WriteLine($"relativeWins: {relativeWins}");
            double averageSkillA = ELO.AverageSkill(teamA);
            double averageSkillB = ELO.AverageSkill(teamB);

            winChance = ELO.WinChance(averageSkillA, averageSkillB);
            //Console.WriteLine($"average Skill team A: {averageSkillA}");
            //Console.WriteLine($"average Skill team B: {averageSkillB}");
            //Console.WriteLine($"winChance: {winChance}");
            double averageChance = (relativeWins + winChance) / 2;

            //Console.WriteLine($"averageChance: {averageChance}");

            return(Wins(averageChance));
        }
        public override bool Beats(Player[] teamA, Player[] teamB, out double winChance)
        {
            double totalChance = 0;
            int    teamSize    = teamA.Length;

            for (int p = 0; p < teamSize; p++)
            {
                totalChance += ELO.WinChance(teamA[p].trueskill, teamB[p].trueskill);
            }

            double averageChance = totalChance / (double)teamSize;

            winChance = averageChance;

            return(Wins(averageChance));
        }
Beispiel #3
0
 public override bool Beats(Player[] teamA, Player[] teamB, out double winChance)
 {
     winChance = ELO.WinChance(ELO.AverageSkill(teamA), ELO.AverageSkill(teamB));
     return(Wins(winChance));
 }