JuliaPOMDP / BasicPOMCP.jl

The PO-UCT algorithm (aka POMCP) implemented in Julia
Other
35 stars 17 forks source link

POMDPs.value doesn't work w/ POMCPPlanner #37

Open FlyingWorkshop opened 4 months ago

FlyingWorkshop commented 4 months ago

I was trying to do some benchmarking for the upcoming CompressedBeliefMDPs.jl package and ran into some trouble when trying to use POMDPs.value on POMCPPlanner. Is this expected behavior? POMCPPlanner subclasses POMDPs.Policy, so I thought it would support the POMDPs.jl interface.

Steps to Recreate

using BasicPOMCP
using POMDPs
using POMDPTools
using POMDPModels

pomdp = BabyPOMDP()
solver = POMCPSolver()
planner = solve(solver, pomdp)
r = value(planner, initialstate(pomdp))

Error

ERROR: LoadError: MethodError: no method matching value(::POMCPPlanner{BabyPOMDP, BasicPOMCP.SolvedPORollout{RandomPolicy{Random._GLOBAL_RNG, BabyPOMDP, NothingUpdater}, NothingUpdater, Random._GLOBAL_RNG}, Random._GLOBAL_RNG}, ::BoolDistribution)

Closest candidates are:
  value(::MCTS.MCTSPlanner, ::Any)
   @ MCTS ~/.julia/packages/MCTS/AjLdf/src/vanilla.jl:199
  value(::MCTS.MCTSTree, ::Any)
   @ MCTS ~/.julia/packages/MCTS/AjLdf/src/vanilla.jl:206
  value(::MCTS.MCTSPlanner{<:Union{MDP, POMDP}, S, A}, ::S, ::A) where {S, A}
   @ MCTS ~/.julia/packages/MCTS/AjLdf/src/vanilla.jl:214
  ...

Stacktrace:
 [1] top-level scope
   @ ~/VSCodeProjects/BeliefCompression/demos/pomcp_test.jl:9
in expression starting at /Users/logan/VSCodeProjects/BeliefCompression/demos/pomcp_test.jl:9
mykelk commented 4 months ago

I think some online algorithms do not do not support value.