injektion / glicko2
A PHP implementation of Glicko2 rating system
v1.1.0
2025-03-10 23:30 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: ^12.0
This package is not auto-updated.
Last update: 2025-07-15 23:31:13 UTC
README
A PHP implementation of Glicko2 rating system
Installation
Composer
The preferred way to install this extension is through Composer.
Either run
php composer.phar require zelenin/glicko2 "~1.0.0"
or add
"zelenin/glicko2": "~1.0.0"
to the require section of your composer.json
Usage
Create two players with current ratings:
use Zelenin\Glicko2\Glicko2; use Zelenin\Glicko2\Gamematch; use Zelenin\Glicko2\MatchCollection; use Zelenin\Glicko2\Player; $glicko = new Glicko2(); $player1 = new Player(1700, 250, 0.05); $player2 = new Player(); $gameMatch = new Gamematch($player1, $player2, 1, 0); $glicko->calculateMatch($gameMatch); $gameMatch = new Gamematch($player1, $player2, 3, 2); $glicko->calculateMatch($gameMatch); // or $matchCollection = new MatchCollection(); $matchCollection->addMatch(new Gamematch($player1, $player2, 1, 0)); $matchCollection->addMatch(new Gamematch($player1, $player2, 3, 2)); $glicko->calculateMatches($matchCollection); $newPlayer1R = $player1->getR(); $newPlayer2R = $player2->getR();
Author
Aleksandr Zelenin, e-mail: aleksandr@zelenin.me