Elo<T> class

Simplified Elo rating.

Similar to FIDE (Chess), just takes an n value, implying that a player that has n more points is 10 times stronger.

The k factor determines how aggressively a rating is changed after new results. FIDE uses different ratings for new and old players (allowing bigger changes in the beginning, and then slowing down the changes). This class does not support changes.

Also, there is no way to use a different initial rating. FIDE, for example, computes the initial rating out of the first games.

See https://blog.mackie.io/the-elo-algorithm for a good description of the algorithm.

Constructors

Elo({double? defaultInitialRating, required double n, required double kFactor})
Creates a new Elo class.

Properties

hashCode int
The hash code for this object.
no setterinherited
ratings Map<T, double>
Returns the current ratings for all players.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addPlayer(T player, double? rating) → void
Adds a new player to the model.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recordResult(T player1, T player2, double score) → void
Records the result of a game.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited