diff --git a/src/time_slice.rs b/src/time_slice.rs index c5e512c..dbdaaaa 100644 --- a/src/time_slice.rs +++ b/src/time_slice.rs @@ -133,25 +133,21 @@ impl Event { skills: &mut SkillStore, agents: &CompetitorStore, p_draw: f64, + convergence: crate::ConvergenceOptions, arena: &mut ScratchArena, ) { let teams = self.within_priors(false, false, skills, agents); let result = self.outputs(); let g = match self.kind { - EventKind::Ranked => Game::ranked_with_arena( - teams, - &result, - &self.weights, - p_draw, - crate::ConvergenceOptions::default(), - arena, - ), + EventKind::Ranked => { + Game::ranked_with_arena(teams, &result, &self.weights, p_draw, convergence, arena) + } EventKind::Scored { score_sigma } => Game::scored_with_arena( teams, &result, &self.weights, score_sigma, - crate::ConvergenceOptions::default(), + convergence, arena, ), }; @@ -175,7 +171,6 @@ pub struct TimeSlice { pub(crate) skills: SkillStore, pub(crate) time: T, p_draw: f64, - #[allow(dead_code)] pub(crate) convergence: crate::ConvergenceOptions, arena: ScratchArena, pub(crate) color_groups: ColorGroups, @@ -335,7 +330,7 @@ impl TimeSlice { &result, &event.weights, self.p_draw, - crate::ConvergenceOptions::default(), + self.convergence, &mut self.arena, ), EventKind::Scored { score_sigma } => Game::scored_with_arena( @@ -343,7 +338,7 @@ impl TimeSlice { &result, &event.weights, score_sigma, - crate::ConvergenceOptions::default(), + self.convergence, &mut self.arena, ), }; @@ -397,6 +392,7 @@ impl TimeSlice { } let range = self.color_groups.color_range(color_idx); let p_draw = self.p_draw; + let convergence = self.convergence; if group_len >= RAYON_THRESHOLD { // Obtain a raw pointer from the unique `&mut self.skills` reference. @@ -414,12 +410,18 @@ impl TimeSlice { ARENA.with(|cell| { let mut arena = cell.borrow_mut(); arena.reset(); - ev.iteration_direct(skills, agents, p_draw, &mut arena); + ev.iteration_direct(skills, agents, p_draw, convergence, &mut arena); }); }); } else { for ev in &mut self.events[range] { - ev.iteration_direct(&mut self.skills, agents, p_draw, &mut self.arena); + ev.iteration_direct( + &mut self.skills, + agents, + p_draw, + self.convergence, + &mut self.arena, + ); } } } @@ -441,7 +443,13 @@ impl TimeSlice { // allowed within a single method body. let p_draw = self.p_draw; for ev in &mut self.events[range] { - ev.iteration_direct(&mut self.skills, agents, p_draw, &mut self.arena); + ev.iteration_direct( + &mut self.skills, + agents, + p_draw, + self.convergence, + &mut self.arena, + ); } } } @@ -527,7 +535,7 @@ impl TimeSlice { &result, &event.weights, self.p_draw, - crate::ConvergenceOptions::default(), + self.convergence, arena, ) .evidence @@ -537,7 +545,7 @@ impl TimeSlice { &result, &event.weights, score_sigma, - crate::ConvergenceOptions::default(), + self.convergence, arena, ) .evidence