openskill

Crates.ioopenskill
lib.rsopenskill
version0.0.1
sourcesrc
created_at2023-12-25 12:49:43.420866
updated_at2023-12-25 12:49:43.420866
descriptionRust implementation of OpenSkill (license free TrueSkill)
homepage
repository
max_upload_size
id1080222
size74,365
injae (injae)

documentation

README

Openskill-RS

Test

Description

Rust Implementation of the Weng-Lin Rating.

This library is based on the openskill.js library

Installation

# TODO
cargo install openskill

Usage

use openskill::prelude::*;

fn main() -> Result<(), OpenSkillError> {
    let team1 = vec![Rating::default()]; 
    let team2 = vec![Rating::new(35.0, 7.0)];

    let teams = vec![team1.clone(), team2.clone()];

    let env = Env::default(); // == EnvBuilder::default().model(ModelKind::PlackettLuce).build()
    let draw_prob = env.predict_draw(&teams)?;
    let win_rate = env.predict_win(&teams)?;
    println!("teams: {teams:?}");
    println!("draw probability: {draw_prob}, win rate: {win_rate:?}");

    let new_rate = env.rate(&GameResult::new(teams.clone(), vec![1, 2]))?;
    println!("before: {teams:?}\n after: {new_rate:?}");
    Ok(())
}
Commit count: 0

cargo fmt