/// <summary> /// Run through all players within a resultset and calculate their new ratings. /// /// Players within the resultset who did not compete during the rating period /// will have see their deviation increase (in line with Prof Glickman's paper). /// /// Note that this method will clear the results held in the association result set. /// </summary> /// <param name="results"></param> public void UpdateRatings(RatingPeriodResults results) { foreach (var player in results.GetParticipants()) { if (results.GetResults(player).Count > 0) { CalculateNewRating(player, results.GetResults(player)); } else { // if a player does not compete during the rating period, then only Step 6 applies. // the player's rating and volatility parameters remain the same but deviation increases player.SetWorkingRating(player.GetGlicko2Rating()); player.SetWorkingRatingDeviation(CalculateNewRatingDeviation(player.GetGlicko2RatingDeviation(), player.GetVolatility())); player.SetWorkingVolatility(player.GetVolatility()); } } // now iterate through the participants and confirm their new ratings foreach (var player in results.GetParticipants()) { player.FinaliseRating(); } // lastly, clear the result set down in anticipation of the next rating period results.Clear(); }
/// <summary> /// Run through all players within a resultset and calculate their new ratings. /// /// Players within the resultset who did not compete during the rating period /// will have see their deviation increase (in line with Prof Glickman's paper). /// /// Note that this method will clear the results held in the association result set. /// </summary> /// <param name="results"></param> public void UpdateRatings(RatingPeriodResults results) { UpdateWorkingRatings(results); // now iterate through the participants and confirm their new ratings foreach (var player in results.GetParticipants()) { player.FinaliseRating(); } // lastly, clear the result set down in anticipation of the next rating period results.Clear(); }
public void UpdateWorkingRatings(RatingPeriodResults results) { foreach (var player in results.GetParticipants()) { if (results.GetResults(player).Count > 0) { CalculateNewRating(player, results.GetResults(player)); } else { // if a player does not compete during the rating period, then only Step 6 applies. // the player's rating and volatility parameters remain the same but deviation increases player.SetWorkingRating(player.GetGlicko2Rating()); player.SetWorkingRatingDeviation(CalculateNewRatingDeviation(player.GetGlicko2RatingDeviation(), player.GetVolatility())); player.SetWorkingVolatility(player.GetVolatility()); } } }