From 2a0299aec7e83fd978cb584ba8051c7ec6fb8866 Mon Sep 17 00:00:00 2001 From: John Tramm Date: Tue, 24 Jun 2025 15:20:26 -0500 Subject: [PATCH] Limit Random Ray Weight Window Generation to Final Batch (#3464) --- src/simulation.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/simulation.cpp b/src/simulation.cpp index f8d4e5470..d9a4fd131 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -400,8 +400,11 @@ void finalize_batch() simulation::time_tallies.stop(); // update weight windows if needed - for (const auto& wwg : variance_reduction::weight_windows_generators) { - wwg->update(); + if (settings::solver_type != SolverType::RANDOM_RAY || + simulation::current_batch == settings::n_batches) { + for (const auto& wwg : variance_reduction::weight_windows_generators) { + wwg->update(); + } } // Reset global tally results