Difference between revisions of "CoopetitionELO"
From #openttdcoop wiki
| (5 intermediate revisions by one other user not shown) | |||
| Line 3: | Line 3: | ||
The Calculation-Routine | The Calculation-Routine | ||
<pre> | <pre> | ||
| − | function | + | function new_ELO_rating($team1_score, $team1_rating, $team2_rating) |
{ | { | ||
$k_factor = 32; | $k_factor = 32; | ||
| Line 13: | Line 13: | ||
$team1_score: 1 (win), 0,5 (draw), 0 (lost) | $team1_score: 1 (win), 0,5 (draw), 0 (lost) | ||
| + | |||
$team1_rating: the old rating of team1 | $team1_rating: the old rating of team1 | ||
| + | |||
$team2_rating: the old rating of team2 | $team2_rating: the old rating of team2 | ||
| + | |||
How much points a team gain or loose depends on the expected rating: | How much points a team gain or loose depends on the expected rating: | ||
| Line 23: | Line 26: | ||
Here are our owns: | Here are our owns: | ||
| − | {| | + | {| width="200px" |
!Ratings | !Ratings | ||
!$k_factor | !$k_factor | ||
| Line 35: | Line 38: | ||
| >= 1400 | | >= 1400 | ||
|16 | |16 | ||
| + | |- | ||
| >= 1600 | | >= 1600 | ||
| 8 | | 8 | ||
| + | |- | ||
| + | |<= 800 | ||
| + | |64 | ||
|} | |} | ||
| + | |||
| + | [[Category:Coopetition]] | ||
Latest revision as of 22:28, 26 August 2006
To get a fair ranking we are using the ELO-Rating which is very popular, well-known and used in sports like Chess and Go.
The Calculation-Routine
function new_ELO_rating($team1_score, $team1_rating, $team2_rating)
{
$k_factor = 32;
$rating_expected = 1 /(1+10^(($team2_rating-$team1_rating)/400));
$new_rating = $team1_rating + ($k_factor * ($team1_score - $rating_expected));
return $new_rating;
}
$team1_score: 1 (win), 0,5 (draw), 0 (lost)
$team1_rating: the old rating of team1
$team2_rating: the old rating of team2
How much points a team gain or loose depends on the expected rating:
I.e. Garri Kasparow (Elo: 2806) looses against Zsuzsa Polgar (Elo: 2577), its expected that Garri Kasparow wins with 0,789 (=78,9%)
In the next step he will loose more points, because it was more expacted he wins!
How many points he will loose depends on the $k_factor, the $k_factor changes with the stats (games played, rating) of a player/team.
The FIDE made some proposals for this $factor some time ago, which DON'T fit to our ladder, instead we will use our own $k_factor's
Here are our owns:
| Ratings | $k_factor |
|---|---|
| <1200 | 32 |
| >= 1200 | 24 |
| >= 1400 | 16 |
| >= 1600 | 8 |
| <= 800 | 64 |