Skip to content

Commit

Permalink
Merge pull request #12 from JuliaPOMDP/dep-alpha-vector-constructor
Browse files Browse the repository at this point in the history
deprecated AlphaVectorPolicy(m, alphas)
  • Loading branch information
zsunberg committed Jun 6, 2019
2 parents 0c694ac + 0d241be commit 0d96c2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/alpha_vector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ struct AlphaVectorPolicy{P<:POMDP, A} <: Policy
action_map::Vector{A}
end

function AlphaVectorPolicy(pomdp::POMDP, alphas)
AlphaVectorPolicy(pomdp, alphas, ordered_actions(pomdp))
end
@deprecate AlphaVectorPolicy(pomdp::POMDP, alphas) AlphaVectorPolicy(pomdp, alphas, ordered_actions(pomdp))

# assumes alphas is |S| x (number of alpha vecs)
function AlphaVectorPolicy(p::POMDP, alphas::Matrix{Float64}, action_map)
Expand Down
2 changes: 1 addition & 1 deletion test/test_alpha_policy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
# these values were gotten from FIB.jl
# alphas = [-29.4557 -36.5093; -19.4557 -16.0629]
alphas = [ -16.0629 -19.4557; -36.5093 -29.4557]
policy = AlphaVectorPolicy(pomdp, alphas)
policy = AlphaVectorPolicy(pomdp, alphas, ordered_actions(pomdp))

@test Set(alphapairs(policy)) == Set([[-16.0629, -36.5093]=>false, [-19.4557, -29.4557]=>true])
@test Set(alphavectors(policy)) == Set([[-16.0629, -36.5093], [-19.4557, -29.4557]])
Expand Down

0 comments on commit 0d96c2e

Please sign in to comment.