Giter VIP home page Giter VIP logo

rating's Introduction

rating

GoDoc Go Report Card Test

Usage: basic

This is the Go implementation of Gliko2 Rating In a simple use case we use as follows

Import the package

import "github.com/mashiike/rating"

Batch by Rating Period.

At the end of each rating period, it reflects the results of the game played in that period.

player := rating.New(1500.0, 200.0, 0.06)
opponents := []rating.Rating{
	rating.New(1400.0, 30.0, 0.06),
	rating.New(1550.0, 100.0, 0.06),
	rating.New(1700.0, 300.0, 0.06),
}
scores := []float64{
	rating.ScoreWin,
	rating.ScoreLose,
	rating.ScoreLose,
}
updated, _ := player.Update(opponents, scores, 0.5)

Sequentially for each game

Use Esteminated struct as follows. Then save the information in a database or file system etc.

player := rating.New(1500.0, 200.0, 0.06)
e := rating.NewEstimated(r)
opponent := rating.New(1400.0, 30.0, 0.06)
err := e.ApplyMatch(opponent, rating.ScoreWin)
//when the rating period is over
err = e.Fix(0.5)
updated := e.Fixed

Usage: use rating util GoDoc

svc := ratingutil.New(ratingutil.NewConfig())
team1 := svc.NewTeam(
	"bovidae",
	ratingutil.Players{
		svc.NewPlayer(
			"sheep",
			rating.New(1700.0, 50.0, svc.Config.InitialVolatility()),
			svc.Config.Now(),
		),
		svc.NewDefaultPlayer("goat"),
	},
)
team2 := svc.NewTeam(
	"equidae",
	ratingutil.Players{
		svc.NewPlayer(
			"donkey",
			rating.New(1400.0, 50.0, svc.Config.InitialVolatility()),
			svc.Config.Now(),
		),
		svc.NewDefaultPlayer("zebra"),
	},
)
match, _ := svc.NewMatch(team1, team2)
match.Add(team1, 1.0)
match.Add(team2, 0.0)
err := svc.Apply(match)

rating's People

Contributors

mashiike avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

rating's Issues

matchmaking utility package

Create matchmaking package
Provides utilities for matchmaking.

Basically, the following interface is considered.

type Element interface {
  Rating() rating.Rating
  MemberCount() int
}

Provide a Queue that can store anything that satisfies this interface.

When Queue reaches the specified number, it tries to return the combination of the match via the channel.

The algorithm is considered to be an annealing method or one using the Gale-Shapley algorithm.

It has become difficult to write in English

The owner of this repository has no English ability, so we use Google Translate to translate it sequentially.

Soon, it's getting hard. May I write in my native language?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.