Skip to content

Commit

Permalink
rm ba_action from tree
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiffleFish committed May 20, 2023
1 parent 844e4f6 commit 9011393
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions src/tree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ struct SARSOPTree
Qa_lower::Vector{Vector{Float64}}

ba_children::Vector{UnitRange{Int}} # [ba_idx][o_idx] => bp_idx
ba_action::Vector{Int}
poba::Vector{Vector{Float64}} # [ba_idx][o_idx] => p(o|ba)

_discount::Float64
Expand Down Expand Up @@ -54,7 +53,6 @@ function SARSOPTree(solver, pomdp::POMDP)
Vector{Float64}[],
Vector{Float64}[],
Vector{Int}[],
Int[],
Vector{Float64}[],
discount(pomdp),
BitVector(),
Expand Down Expand Up @@ -156,7 +154,6 @@ function add_action!(tree::SARSOPTree, b_idx::Int, a::Int)
ba_idx = length(tree.ba_children) + 1
push!(tree.ba_children, NO_CHILDREN)
push!(tree.ba_pruned, true)
push!(tree.ba_action, a)
return ba_idx
end

Expand Down
3 changes: 1 addition & 2 deletions test/tree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
@test length(tree.V_lower) == n_b
@test length(tree.Qa_upper) == n_b
@test length(tree.Qa_lower) == n_b
@test length(tree.ba_action) == n_ba
@test length(tree.poba) == n_ba
@test length(tree.b_pruned) == n_b
@test length(tree.ba_pruned) == n_ba
Expand Down Expand Up @@ -80,7 +79,7 @@
JSOP.fill_belief!(tree, b_idx)
Q̲, Q̄, ap_idx = JSOP.max_r_and_q(tree, b_idx)
ba_idx = tree.b_children[b_idx][ap_idx]
a′ = tree.ba_action[ba_idx]
a′ = ap_idx
Rba′ = JSOP.belief_reward(tree, tree.b[b_idx], a′)
L′ = max(L, Q̲)
U′ = max(U, Q̲ + γ^(-t)*ϵ)
Expand Down

0 comments on commit 9011393

Please sign in to comment.