mirror of
https://github.com/cassoule/flopobot_v2.git
synced 2026-03-18 21:40:27 +01:00
Merge pull request #73 from cassoule/milo-260130
elo loss factor adjusted
This commit is contained in:
@@ -47,16 +47,16 @@ export async function eloHandler(p1Id, p2Id, p1Score, p2Score, type, scores = nu
|
|||||||
const p1Change = K_FACTOR * (p1Score - expectedP1);
|
const p1Change = K_FACTOR * (p1Score - expectedP1);
|
||||||
const p2Change = K_FACTOR * (p2Score - expectedP2);
|
const p2Change = K_FACTOR * (p2Score - expectedP2);
|
||||||
|
|
||||||
// Make losing friendlier: loser loses 80% of what winner gains
|
// Make losing friendlier: loser loses 70% of what winner gains
|
||||||
let finalP1Change = p1Change;
|
let finalP1Change = p1Change;
|
||||||
let finalP2Change = p2Change;
|
let finalP2Change = p2Change;
|
||||||
|
|
||||||
if (p1Score > p2Score) {
|
if (p1Score > p2Score) {
|
||||||
// P1 won, P2 lost
|
// P1 won, P2 lost
|
||||||
finalP2Change = p2Change * 0.8;
|
finalP2Change = p2Change * 0.7;
|
||||||
} else if (p2Score > p1Score) {
|
} else if (p2Score > p1Score) {
|
||||||
// P2 won, P1 lost
|
// P2 won, P1 lost
|
||||||
finalP1Change = p1Change * 0.8;
|
finalP1Change = p1Change * 0.7;
|
||||||
}
|
}
|
||||||
// If it's a draw (p1Score === p2Score), keep the original changes
|
// If it's a draw (p1Score === p2Score), keep the original changes
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user