keypax/glicko2
最新稳定版本:1.1.1
Composer 安装命令:
composer require keypax/glicko2
包简介
A PHP implementation of the Glicko2 rating system. Fork of zelenin/glicko2, updated and compatible with PHP 8.1+
README 文档
README
A PHP implementation of Glicko2 rating system Fork of zelenin/glicko2 with PHP 8.1 support
Installation
Composer
composer require keypax/glicko2:"^1.0.0"
Usage
Create two players with current ratings:
use Zelenin\Glicko2\Glicko2; use Zelenin\Glicko2\RatingMatch; use Zelenin\Glicko2\RatingMatchCollection; use Zelenin\Glicko2\Player; $glicko = new Glicko2(); $player1 = new Player(1700, 250, 0.05); $player2 = new Player(); $ratingMatch = new RatingMatch($player1, $player2, 1, 0); $glicko->calculateRatingMatch($ratingMatch); $ratingMatch = new RatingMatch($player1, $player2, 3, 2); $glicko->calculateRatingMatch($ratingMatch); // or $ratingMatchCollection = new RatingMatchCollection(); $ratingMatchCollection->addRatingMatch(new RatingMatch($player1, $player2, 1, 0)); $ratingMatchCollection->addRatingMatch(new RatingMatch($player1, $player2, 3, 2)); $glicko->calculateRatingMatches($ratingMatchCollection); $newPlayer1R = $player1->getR(); $newPlayer2R = $player2->getR();
Author
Aleksandr Zelenin, e-mail: aleksandr@zelenin.me
统计信息
- 总下载量: 2.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-05