From 3e10a8c51424af1744e902ea1d63a1ad306dcaed Mon Sep 17 00:00:00 2001 From: qhho Date: Sun, 28 Jul 2024 20:31:21 -0700 Subject: [PATCH] duplicate check during backup --- src/backup.jl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/backup.jl b/src/backup.jl index b48b5d9..b54d8b7 100644 --- a/src/backup.jl +++ b/src/backup.jl @@ -76,9 +76,13 @@ function backup!(tree, b_idx) best_action = a end end - - α = AlphaVec(best_α, best_action, Set(b_idx)) - push!(Γ, α) + α_idx = findfirst(x->x == best_α, Γ) + if α_idx === nothing + α = AlphaVec(best_α, best_action, Set(b_idx)) + push!(Γ, α) + else + union!(Γ[α_idx].witnesses, b_idx) + end tree.V_lower[b_idx] = V end