예제 #1
0
 public static MatchFormatDto AssembleDto(this MatchFormat matchFormat)
 {
     return(new MatchFormatDto
     {
         ID = matchFormat.ID,
         Name = matchFormat.Name,
         GameVariations = matchFormat.GameVariations.Select(x => x.AssembleDto())
     });
 }
예제 #2
0
파일: Form1.cs 프로젝트: Wailord/Lounger
        private double get_win_probability(Moserware.Skills.Rating team_a_rating, Moserware.Skills.Rating team_b_rating, MatchFormat format, out bool team_a_favored)
        {
            double chance;
            double elo_diff;
            team_a_favored = (team_a_rating.ConservativeRating > team_b_rating.ConservativeRating);
            elo_diff = Math.Abs(team_a_rating.ConservativeRating - team_b_rating.ConservativeRating);

            // nuts rankings
            //chance = 1 - 1 / (1 + Math.Exp(0.00583 * elo_diff));
            //chance = 0.0007 * elo_diff + 0.5;
            //chance = .5 + elo_diff * 0.001;
            //chance = 0.0013 * elo_diff + 0.5;

            // swolepoints
            // old
            //chance = 0.2709 * Math.Pow(elo_diff * 100, 0.1861);
            // new
            //chance = .269 * Math.Pow(50 * elo_diff, 0.184);
            // higher r2 val
            //chance = 2 * Math.Pow(10, -10) * Math.Pow(elo_diff * 50, 3) - (7 * Math.Pow(10, -7) * Math.Pow(elo_diff * 50, 2)) + .0001 * (elo_diff * 50) + 0.5;
            // low r2, seems to get $$$
            chance = 0.0005 * elo_diff * 50 + 0.5;
            //chance = 0.2565 * Math.Pow(50 * elo_diff, 0.1951);

            // ts formula
            //chance = -4 * Math.Pow(10, -7) * Math.Pow(elo_diff * 50, 2) + .0009 * elo_diff * 50 + 0.5;
            //chance = .0011 * elo_diff * 50 + 0.5;

            if (format == MatchFormat.BestOf2)
                return get_bo2_chance(chance);
            else if (format == MatchFormat.BestOf3)
                return get_bo3_chance(chance);
            else if (format == MatchFormat.BestOf5)
                return get_bo5_chance(chance);
            else
                return chance;
        }