Skip to content

Commit

Permalink
Fix belief pruning (#17)
Browse files Browse the repository at this point in the history
* Change all_ba_pruned flag

* Actually change all_ba_pruned flag
  • Loading branch information
bkraske authored Jun 22, 2024
1 parent da75251 commit a7178b7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/prune.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,17 @@ 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)
all_ba_pruned = true
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
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
all_ba_pruned && (tree.b_pruned[b_idx] = true)
end
end
end
Expand Down

0 comments on commit a7178b7

Please sign in to comment.