GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - floitsch/ranking: A Dart package to compute rankings of players from game results.

BranchesTags
Open more actions menu

Latest commit

 

History

16 Commits
16 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
example
example
 
 
lib
lib
 
 
test
test
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
analysis_options.yaml
analysis_options.yaml
 
 
pubspec.yaml
pubspec.yaml
 
 
ranking.iml
ranking.iml
 
 

Repository files navigation

A simple library to rank players.

This package contains functions to rank players, given the results of their games.

For static rankings, where players don't change their skill-level, the Bradley-Terry model computes a score for each player that predicts the probability at which one player would win against another.

For dynamic rankings, where players change their skill-level over time, the ELO ranking system provides a score that dynamically adjust with the results of the players.

Usage

A simple usage example for Bradley-Terry:

import 'package:ranking/ranking.dart';

main() {
  // In the following list the first entry in the pair (representing a game)
  // won that game.
  var games = [
    ["Player 2", "Player 1"],  // Player 2 won over Player 1.
    ["Player 2", "Player 3"],
    ["Player 3", "Player 2"],
    ["Player 3", "Player 2"],
  ];
  var scores = computeBradleyTerryScores(games);
  // The `scores` map contains a score for each player:
  //   Player 1 -> 0.000
  //   Player 2 -> 0.333
  //   Player 3 -> 0.667
}

A simple usage example for ELO:

import 'package:ranking/ranking.dart';

main() {
  // The game-scope (3rd column) indicates the result of the game:
  //   * 1.0: the first player won decisively.
  //   * 0.5: a draw.
  //   * 0.0: the second player won decisively.
  var games = [
    ["Player 2", "Player 1", 1.0],
    ["Player 3", "Player 2", 0.5],
    ["Player 3", "Player 1", 0.0],
    ["Player 3", "Player 2", 1.0],
    ["Player 2", "Player 3", 1.0],
  ];

  var elo = new Elo(
      defaultInitialRating: 100,
      // With an `n` of 30, a difference of 30 in score means that the
      // stronger player is 10 times more likely to win.
      n:  30,
      // How much new game-results move the score. With 10, players with
      // the same score will have a difference of 10 after a decisive
      // victory/loss.
      kFactor: 10
  );

  games.forEach((list) { elo.recordResult(list[0], list[1], list[2] as double); });

  var ratings = elo.ratings;
  // The `rating` map contains a rating for each player:
  //   Player 1 -> 101
  //   Player 2 -> 103
  //   Player 3 ->  95
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

About

A Dart package to compute rankings of players from game results.

Resources

Readme
Apache-2.0 license
Activity

Stars

4 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.