定制 zelenin/glicko2 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zelenin/glicko2

最新稳定版本:1.0.0

Composer 安装命令:

composer require zelenin/glicko2

包简介

A PHP implementation of Glicko2 rating system

README 文档

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\Match;
use Zelenin\Glicko2\MatchCollection;
use Zelenin\Glicko2\Player;

$glicko = new Glicko2();

$player1 = new Player(1700, 250, 0.05);
$player2 = new Player();

$match = new Match($player1, $player2, 1, 0);
$glicko->calculateMatch($match);

$match = new Match($player1, $player2, 3, 2);
$glicko->calculateMatch($match);

// or

$matchCollection = new MatchCollection();
$matchCollection->addMatch(new Match($player1, $player2, 1, 0));
$matchCollection->addMatch(new Match($player1, $player2, 3, 2));
$glicko->calculateMatches($matchCollection);

$newPlayer1R = $player1->getR();
$newPlayer2R = $player2->getR();

Author

Aleksandr Zelenin, e-mail: aleksandr@zelenin.me

统计信息

  • 总下载量: 1.96k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 2
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-18