Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Commit

Permalink
a few changes to make things more general, export some things
Browse files Browse the repository at this point in the history
  • Loading branch information
zsunberg committed Feb 23, 2017
1 parent b3b31ea commit 41edd44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/POMCP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export
RootUpdater,
BeliefNode,
RootNode,
ObservationNode,
ObsNode,
ActNode,
POMCPTreeVisualizer,

solve,
Expand All @@ -36,6 +37,7 @@ export
sparse_actions,
estimate_value,
extract_belief,
add_N,

RandomActionGenerator,
next_action,
Expand Down
6 changes: 3 additions & 3 deletions src/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# replace recursion with while loop
# cache simulation results

function create_policy{S}(solver::Union{POMCPSolver,POMCPDPWSolver}, pomdp::POMDPs.POMDP{S})
function create_policy{S}(solver::AbstractPOMCPSolver, pomdp::POMDPs.POMDP{S})
if isa(solver.node_belief_updater, DefaultReinvigoratorStub)
node_belief_updater = DeadReinvigorator{S}()
else
Expand All @@ -27,11 +27,11 @@ end
Simply return a properly constructed POMCPPlanner object.
"""
function solve{S}(solver::Union{POMCPSolver,POMCPDPWSolver}, pomdp::POMDPs.POMDP{S})
function solve{S}(solver::AbstractPOMCPSolver, pomdp::POMDPs.POMDP{S})
create_policy(solver, pomdp)
end

solve(solver::Union{POMCPSolver,POMCPDPWSolver}, pomdp::POMDPs.POMDP, dummy_policy::Any) = solve(solver, pomdp)
solve(solver::AbstractPOMCPSolver, pomdp::POMDPs.POMDP, dummy_policy::Any) = solve(solver, pomdp)

"""
function search(pomcp::POMCPPlanner, b::BeliefNode, tree_queries)
Expand Down
1 change: 0 additions & 1 deletion src/visualization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ blink(n::BeliefNode) = blink(POMCPTreeVisualizer(n))
typealias NodeDict Dict{Int, Dict{String, Any}}

function create_json(v::POMCPTreeVisualizer)
complete = false
node_dict = NodeDict()
dict = recursive_push!(node_dict, v.node)
json = JSON.json(node_dict)
Expand Down

0 comments on commit 41edd44

Please sign in to comment.