public class Rating extends Object implements RatingCodes
| Modifier and Type | Field and Description |
|---|---|
int |
experience
The number of times the player's played our game.
|
int |
rating
The player's rating for our game.
|
DEFAULT_RATING, MAXIMUM_RATING, MINIMUM_RATING| Constructor and Description |
|---|
Rating() |
| Modifier and Type | Method and Description |
|---|---|
static float |
computeAdjustment(float W,
int opprat,
Rating rating)
Computes a ratings adjustment for the given player, using a modified
version of the FIDE Chess rating system as:
|
static int |
computeRating(Rating[] ratings,
int pidx,
float W)
Computes a player's updated rating using a modified version of the
FIDE/ELO system.
|
boolean |
isProvisional()
Returns true if this rating is provisional (
experience < 20). |
String |
toString() |
public int rating
public int experience
public static int computeRating(Rating[] ratings, int pidx, float W)
ratings - the pre-match ratings of each of the opponents.pidx - the index of the player whose rating is to be calculated.W - the win value for the player whose rating is to be calculated,
(1.0 means the player won, 0.5 means they drew, 0 means they lost).public static float computeAdjustment(float W,
int opprat,
Rating rating)
adjustment = K(W - We)
where:
K = if (experience < 20) then 64
else if (rating < 2100 and experience >= 20) then 32
else if (rating >= 2100 and rating < 2400 and experience >= 20)
then 24
else 16
W = score for the game just completed, as 1.0, 0.5, and 0.0 for a
win, draw, or loss, respectively.
dR = opponent's rating minus player's rating.
We = expected score (win expectancy) as determined by:
We = 1 / (10^(dR/400) + 1)
W - the win value the game in question (1.0 means the player won,
0.5 means they drew, 0 means they lost).opprat - the opponent's current rating.rating - the player's current rating.public boolean isProvisional()
experience < 20).Copyright © 2015. All rights reserved.