Class EloRating
java.lang.Object
org.episteme.social.sports.EloRating
Implementation of the Elo rating system for measuring relative skill levels
in zero-sum games and sports competitions.
Reference: Elo, Arpad (1978). The Rating of Chessplayers, Past and Present.
- Since:
- 1.0
- Version:
- 1.1
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublecalculateExpectedScore(double ratingA, double ratingB) Calculates the expected score (probability of winning) for player A.static doubleupdateRating(double currentRating, double actualScore, double expectedScore, double kFactor) Calculates the newly adjusted rating for a player after a match.
-
Method Details
-
calculateExpectedScore
public static double calculateExpectedScore(double ratingA, double ratingB) Calculates the expected score (probability of winning) for player A.- Parameters:
ratingA- skill rating of player AratingB- skill rating of player B- Returns:
- expected score between 0.0 and 1.0
-
updateRating
public static double updateRating(double currentRating, double actualScore, double expectedScore, double kFactor) Calculates the newly adjusted rating for a player after a match.- Parameters:
currentRating- the previous ratingactualScore- the outcome (1.0 = win, 0.5 = draw, 0.0 = loss)expectedScore- the pre-match probability calculated viacalculateExpectedScore(double, double)kFactor- the sensitivity factor (e.g., 32 for novices, 16 for masters)- Returns:
- the updated Elo rating
-