Home

Awesome

ParticleFilterTrees.jl

CIcodecov

Particle Filter Trees with Double Progressive Widening

Parameters

ParameterTypeDefaultDescription
max_depthInt20Maximum tree search depth
n_particlesInt100Number of particles representing tree node belief
criterionAnyPolyUCB(1.)Action selection criterion
k_oFloat6410.0Initial observation widening parameter
alpha_oFloat640.0Observation progressive widening parameter
k_aFloat645.0Initial action widening parameter
alpha_aFloat640.0Action progressive widening parameter
tree_queriesInt1_000Maximum number of tree search iterations
max_timeFloat64InfMaximum tree search time (in seconds)
rngAbstractRNGRandom.default_rng()Random number generator
value_estimatorAnyFastRandomSolver()Belief node value estimator
check_repeat_obsBooltrueCheck that repeat observations do not overwrite beliefs (added dictionary overhead)
enable_action_pwBoolfalseIncrementally sample and add actions if true; add all actions at once if false
beliefcache_sizeInt1_000Number of particle/weight vectors to cache offline (reduces online array allocations)
treecache_sizeInt1_000Number of belief/action nodes to preallocate in tree (reduces Base._growend! calls)

Usage

using POMDPs, POMDPModels
using ParticleFilterTrees

pomdp = LightDark1D()
b0 = initialstate(pomdp)
solver = PFTDPWSolver(tree_queries=10_000, check_repeat_obs=false)
planner = solve(solver, pomdp)
a = action(planner, b0)

SparsePFT

Using sufficiently large treecache_size and beliefcache_size allows for very few online allocations.

using BenchmarkTools

pomdp = LightDark1D()
b0 = initialstate(pomdp)
solver = SparsePFTSolver(
    max_time            = 0.1, 
    tree_queries        = 100_000, 
    treecache_size      = 50_000, 
    beliefcache_size    = 50_000, 
    check_repeat_obs    = false
)
planner = solve(solver, pomdp)
action(planner, b0)
@btime action(planner, b0)
100.006 ms (0 allocations: 0 bytes)