예제 #1
0
        private int GetRatingToRank(List <Contestant> contestants, Contestant contestant, double rank)
        {
            int left  = 1;
            int right = 8000;

            while (right - left > 1)
            {
                int mid = (left + right) / 2;

                if (GetSeed(contestants, contestant, mid) < rank)
                {
                    right = mid;
                }
                else
                {
                    left = mid;
                }
            }

            return(left);
        }
예제 #2
0
 private double GetEloWinProbability(Contestant a, Contestant b)
 {
     return(GetEloWinProbability(a.Rating, b.Rating));
 }