Added in kFactor ratio application to rating delta.
This commit is contained in:
parent
b69a75355c
commit
757c945320
@ -42,9 +42,17 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
|
||||
{
|
||||
EloTeam newTeam = new EloTeam();
|
||||
|
||||
int newTotal = _ratingSystem.getNewRating(teamA.TotalElo / teamA.getPlayers().size(), teamB.TotalElo / teamB.getPlayers().size(), result);
|
||||
int kTotal = 0;
|
||||
|
||||
for (EloPlayer player : teamA.getPlayers())
|
||||
{
|
||||
int newRating = _ratingSystem.getNewRating(player.getRating(), (teamB.TotalElo / teamB.getPlayers().size()), result);
|
||||
kTotal += _ratingSystem.getKFactor(player.getRating());
|
||||
}
|
||||
|
||||
for (EloPlayer player : teamA.getPlayers())
|
||||
{
|
||||
int newRating = (int)(player.getRating() + ((double)_ratingSystem.getKFactor(player.getRating()) / (double)kTotal) * (newTotal - teamA.TotalElo));
|
||||
EloPlayer newPlayer = new EloPlayer(player.getPlayer(), newRating);
|
||||
|
||||
newTeam.addPlayer(newPlayer);
|
||||
|
@ -57,7 +57,7 @@ public class EloRatingSystem
|
||||
return oldRating + (int) (kFactor * (score - expectedScore));
|
||||
}
|
||||
|
||||
private double getKFactor(int rating)
|
||||
double getKFactor(int rating)
|
||||
{
|
||||
for (int i = 0; i < _kFactors.length; i++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user