public FactorGraphTrueSkillCalculator()
     : base(SupportedOptions.PartialPlay | SupportedOptions.PartialUpdate, TeamsRange.AtLeast(2), PlayersRange.AtLeast(1))
 {
 }
Example #2
0
        private static void ValidateTeamCountAndPlayersCountPerTeam <TPlayer>(IEnumerable <IDictionary <TPlayer, Rating> > teams,
                                                                              TeamsRange totalTeams, PlayersRange playersPerTeam)
        {
            Guard.ArgumentNotNull(teams, "teams");
            var countOfTeams = 0;

            foreach (var currentTeam in teams)
            {
                if (!playersPerTeam.IsInRange(currentTeam.Count))
                {
                    throw new ArgumentException();
                }

                countOfTeams++;
            }

            if (!totalTeams.IsInRange(countOfTeams))
            {
                throw new ArgumentException();
            }
        }
Example #3
0
 /// <summary>
 /// Construct a two-player ELO Calculator.
 /// </summary>
 /// <param name="kFactor">The K-Factor used in ELO calculations.</param>
 protected TwoPlayerEloCalculator(KFactor kFactor)
     : base(SupportedOptions.None, TeamsRange.Exactly(2), PlayersRange.Exactly(1))
 {
     mKFactor = kFactor;
 }
Example #4
0
 /// <summary>
 /// Construct a skill calculator.
 /// </summary>
 /// <param name="supportedOptions">The options that are supported.</param>
 /// <param name="totalTeamsAllowed">The range of teams that are allowed.</param>
 /// <param name="playersPerTeamAllowed">The range of players per team that are allowed.</param>
 protected SkillCalculator(SupportedOptions supportedOptions, TeamsRange totalTeamsAllowed, PlayersRange playersPerTeamAllowed)
 {
     mSupportedOptions      = supportedOptions;
     mTotalTeamsAllowed     = totalTeamsAllowed;
     mPlayersPerTeamAllowed = playersPerTeamAllowed;
 }
Example #5
0
 /// <summary>
 /// Default construction.
 /// </summary>
 /// <param name="twoPlayerEloCalculator">The two player calculator to base this off.</param>
 public DuellingEloCalculator(TwoPlayerEloCalculator twoPlayerEloCalculator)
     : base(SupportedOptions.None, TeamsRange.AtLeast(2), PlayersRange.AtLeast(1))
 {
     mTwoPlayerEloCalculator = twoPlayerEloCalculator;
 }