Skip to content

Commit d2d99b2

Browse files
committed
chore: rename package to eve
1 parent 30d7df2 commit d2d99b2

File tree

6 files changed

+50
-3
lines changed

6 files changed

+50
-3
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tetka-games = { path = "./games" }
1616

1717
[workspace]
1818
resolver = "2"
19-
members = [ "uxi", "games" , "arbiter"]
19+
members = [ "uxi", "games" , "eve"]
2020

2121
[profile.release]
2222
debug = true

arbiter/src/lib.rs

-1
This file was deleted.

arbiter/Cargo.toml eve/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7+
statrs = "0.18.0"
78

89
[profile.release]
910
debug = true
1011
opt-level = 3
1112
codegen-units = 1
12-
lto = true
13+
lto = true
File renamed without changes.
File renamed without changes.

eve/src/stats/sprt.rs

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright © 2025 Rak Laptudirm <[email protected]>
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
14+
use super::{BayesianElo, Wdl};
15+
16+
pub fn llr(ws: usize, ds: usize, ls: usize, elo0: f64, elo1: f64) -> f64 {
17+
let w = ws as f64 + 0.5;
18+
let d = ds as f64 + 0.5;
19+
let l = ls as f64 + 0.5;
20+
21+
let n = w + d + l;
22+
23+
let elo: BayesianElo = Wdl(w / n, l / n).into();
24+
25+
let wdl0 = Wdl::from(BayesianElo(elo0, elo.dlo()));
26+
let wdl1 = Wdl::from(BayesianElo(elo1, elo.dlo()));
27+
28+
w * (wdl1.w() / wdl0.w()).ln() + d * (wdl1.d() / wdl0.d()).ln() + l * (wdl1.l() / wdl0.l()).ln()
29+
}
30+
31+
pub fn elo(ws: usize, ds: usize, ls: usize) -> (f64, f64, f64) {
32+
let n = (ws + ds + ls) as f64 + 1.5;
33+
34+
let w = ws as f64 + 0.5;
35+
let d = ds as f64 + 0.5;
36+
let l = ls as f64 + 0.5;
37+
38+
let mu = w + d / 2.0;
39+
40+
let sigma = f64::sqrt(
41+
w * f64::powi(1.0 - mu, 2) + d * f64::powi(0.5 - mu, 2) + l * f64::powi(0.0 - mu, 2),
42+
) / n.sqrt();
43+
44+
let mu_max = mu;
45+
46+
(0.0, 0.0, 0.0)
47+
}

0 commit comments

Comments
 (0)