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) {
self.play(
&(0..self.players.len())
.flat_map(|i| {
(0..self.players.len())
.map(move |j| (i, j))
.filter(|(i, j)| i != j)
.collect::<Vec<_>>()
})
.collect::<Vec<_>>()
.repeat(n),
);
let mut games = (0..self.players.len())
.flat_map(|i| {
(0..self.players.len())
.map(move |j| (i, j))
.filter(|(i, j)| i != j)
})
.collect::<Vec<_>>()
.repeat(n);
games.shuffle(&mut rand::rng());
self.play(&games);
}
fn process_outcome(&mut self, player1: usize, player2: usize, outcome: &Outcomes) {