|
|
|
@ -13,7 +13,7 @@ module RankKing
|
|
|
|
|
ratings = combo.map {|item| Rating.first(axis:, item:) || OS.rating }
|
|
|
|
|
Math.sqrt(
|
|
|
|
|
[ratings, ratings.reverse]
|
|
|
|
|
.map {|game| [game, OS.rate(game.map {[_1]}).flatten] }
|
|
|
|
|
.map {|game| [game, OS.rate(game).flatten] }
|
|
|
|
|
.sum {|pre,post| pre.zip(post).sum { (_1.sigma - _2.sigma)**2 }}
|
|
|
|
|
)
|
|
|
|
|
}.last
|
|
|
|
@ -23,7 +23,7 @@ module RankKing
|
|
|
|
|
fail unless [winner, loser].all? { _1.pool == axis.pool }
|
|
|
|
|
|
|
|
|
|
game = [winner, loser].map { Rating.first(axis:, item: _1) || OS.rating }
|
|
|
|
|
result = OS.rate(game.map { [_1] }).flatten
|
|
|
|
|
result = OS.rate(game).flatten
|
|
|
|
|
|
|
|
|
|
DB.transaction do
|
|
|
|
|
Ranking.create(axis:, winner:, loser:)
|
|
|
|
|