Skip to content

Commit

Permalink
Change all_ba_pruned flag
Browse files Browse the repository at this point in the history
  • Loading branch information
bkraske committed Jun 21, 2024
1 parent dd819c3 commit d76d454
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/prune.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@ function prune!(tree::SARSOPTree)
Qa_upper = tree.Qa_upper[b_idx]
Qa_lower = tree.Qa_lower[b_idx]
b_children = tree.b_children[b_idx]
ba = tree.b_children[b_idx]
max_lower_bound = maximum(Qa_lower)

for (idx, Qba) enumerate(Qa_upper)
ba_idx = b_children[idx]
all_ba_pruned = true
if !tree.ba_pruned[ba_idx] && Qa_upper[idx] < max_lower_bound
ba_idx = b_children[idx]
if !tree.ba_pruned[ba_idx] && Qba < max_lower_bound
pruneSubTreeBa!(tree, ba_idx)
else
all_ba_pruned = false
end
all_ba_pruned && (tree.b_pruned[b_idx] = true)
end

end
end
end
Expand Down

0 comments on commit d76d454

Please sign in to comment.