elo: shuffle prop_arena

This commit is contained in:
Simon Gardling 2025-04-24 13:02:49 -04:00
parent 57dba8ad1e
commit 84b175d844
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -253,17 +253,16 @@ impl PlayerArena {
} }
fn prop_arena(&mut self, n: usize) { fn prop_arena(&mut self, n: usize) {
self.play( let mut games = (0..self.players.len())
&(0..self.players.len()) .flat_map(|i| {
.flat_map(|i| { (0..self.players.len())
(0..self.players.len()) .map(move |j| (i, j))
.map(move |j| (i, j)) .filter(|(i, j)| i != j)
.filter(|(i, j)| i != j) })
.collect::<Vec<_>>() .collect::<Vec<_>>()
}) .repeat(n);
.collect::<Vec<_>>() games.shuffle(&mut rand::rng());
.repeat(n), self.play(&games);
);
} }
fn process_outcome(&mut self, player1: usize, player2: usize, outcome: &Outcomes) { fn process_outcome(&mut self, player1: usize, player2: usize, outcome: &Outcomes) {