BasicPOMCP.jl icon indicating copy to clipboard operation
BasicPOMCP.jl copied to clipboard

POMDPs.value doesn't work w/ POMCPPlanner

Open FlyingWorkshop opened this issue 11 months ago • 1 comments

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

FlyingWorkshop avatar Mar 17 '24 02:03 FlyingWorkshop

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

mykelk avatar Mar 17 '24 05:03 mykelk