https://github.com/robopuff/rating
An implementation of rating systems (Elo)
https://github.com/robopuff/rating
Last synced: 9 months ago
JSON representation
An implementation of rating systems (Elo)
- Host: GitHub
- URL: https://github.com/robopuff/rating
- Owner: robopuff
- License: other
- Created: 2017-01-13T14:08:26.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-03-29T08:27:40.000Z (about 4 years ago)
- Last Synced: 2025-02-11T20:50:08.170Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Rating
## Elo
[](https://travis-ci.org/robopuff/rating)
[](https://coveralls.io/github/robopuff/rating?branch=master)
Based on Elo rating system, adapted to use over arrays
```php
$elo = new Elo();
$results = $elo->ratePair(1500, 1500, Elo::RESULT_WON_A);
// $results = [1508, 1492];
```
```php
$elo = new Elo();
$results = $elo->rateArray([
// Place on the grid => Current rating
0 => 1500, //1st place
1 => 1500, //2nd place
2 => 1500 //3rd place
// ... Nth place
]);
// $results = [
// 0 => 1510,
// 1 => 1502,
// 2 => 1494,
// n => ...
// ];
```