Dieser Commit ist enthalten in:
Ursprung
9af07f821d
Commit
4422fbdc8b
@ -185,11 +185,11 @@ public class FightEndsHandler extends PacketHandler {
|
||||
}
|
||||
|
||||
private void calcSchemElo(int eloSchemOwn, int eloSchemEnemy, int schemId, double result) {
|
||||
double winSchemExpectation = calsWinExpectation(eloSchemOwn, eloSchemEnemy);
|
||||
double winSchemExpectation = calcWinExpectation(eloSchemOwn, eloSchemEnemy);
|
||||
SchemElo.setElo(schemId, (int) Math.round(eloSchemOwn + K * (result - winSchemExpectation)));
|
||||
}
|
||||
|
||||
private double calsWinExpectation(int eloOwn, int eloEnemy) {
|
||||
private double calcWinExpectation(int eloOwn, int eloEnemy) {
|
||||
return 1 / (1 + Math.pow(10, (eloEnemy - eloOwn) / 600f));
|
||||
}
|
||||
|
||||
@ -212,19 +212,11 @@ public class FightEndsHandler extends PacketHandler {
|
||||
}
|
||||
|
||||
private double getBlueEloFactor(int blueElo, int redElo) {
|
||||
if (blueElo == 0) blueElo = 1;
|
||||
if (redElo == 0) redElo = 1;
|
||||
return sigmoid(redElo / (double) blueElo);
|
||||
return 2 - calcWinExpectation(blueElo, redElo) * 2;
|
||||
}
|
||||
|
||||
private double getRedEloFactor(int blueElo, int redElo) {
|
||||
if (blueElo == 0) blueElo = 1;
|
||||
if (redElo == 0) redElo = 1;
|
||||
return sigmoid(blueElo / (double) redElo);
|
||||
}
|
||||
|
||||
private double sigmoid(double x) {
|
||||
return 1 / (1 + Math.exp(-2 * (x - 1))) * 2;
|
||||
return 2 - calcWinExpectation(redElo, blueElo) * 2;
|
||||
}
|
||||
|
||||
private double getRematchFactor(FightEndsPacket fightEndsPacket) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren