Sparse PFT

Sparse-PFT is PFT with a fixed observation branching factor instead of progressive widening: every action node gets exactly belief_child_num belief children, sampled once. There is nothing to widen and no k_o / alpha_o to tune, so the shape of the tree is decided before the search starts and the budget goes entirely into depth and value estimates.

Use it when the action set is discrete and the budget per decision is small.

Notes

  • c_ucb and beta_ucb set the exploration term; belief_child_num sets the width.

  • Takes a discrete-action environment: it enumerates the action set rather than sampling it.

Can I use?

Discrete

Continuous

State

✔️

✔️

Action

✔️

❌

Observation

✔️

✔️

Also supports

Cost constraints

❌

GPU

❌

Example

import numpy as np
from POMDPPlanners.core.belief import get_initial_belief
from POMDPPlanners.environments.tiger_pomdp import TigerPOMDP
from POMDPPlanners.planners.mcts_planners.sparse_pft import SparsePFT

np.random.seed(42)
tiger = TigerPOMDP(discount_factor=0.95)

planner = SparsePFT(
    environment=tiger,
    discount_factor=0.95,
    depth=5,
    c_ucb=1.0,
    beta_ucb=2.0,
    belief_child_num=3,
    time_out_in_seconds=2.0,
    name="ExamplePlanner",
)

belief = get_initial_belief(tiger, n_particles=10)
actions, run_data = planner.action(belief)

Parameters

class POMDPPlanners.planners.mcts_planners.sparse_pft.SparsePFT(environment, discount_factor, depth, c_ucb, beta_ucb, belief_child_num, time_out_in_seconds=None, n_simulations=None, name='SparsePFT', reserve_capacity=0, log_path=None, debug=False, use_queue_logger=False)[source]

Bases: ArenaPathSimulationPolicy

Sparse-PFT operating on the arena Tree + integer node IDs.

See module docstring for algorithm details.

Example

>>> import numpy as np
>>> from POMDPPlanners.environments.tiger_pomdp import TigerPOMDP
>>> from POMDPPlanners.core.belief import get_initial_belief
>>> np.random.seed(42)
>>>
>>> tiger = TigerPOMDP(discount_factor=0.95)
>>> planner = SparsePFT(
...     environment=tiger,
...     discount_factor=0.95,
...     depth=5,
...     c_ucb=1.0,
...     beta_ucb=2.0,
...     belief_child_num=3,
...     n_simulations=10,
...     name="ExamplePlanner"
... )
>>> planner.name
'ExamplePlanner'
>>>
>>> initial_belief = get_initial_belief(tiger, n_particles=10)
>>> actions, run_data = planner.action(initial_belief)
>>>
>>> space_info = SparsePFT.get_space_info()
>>> space_info.action_space.name
'DISCRETE'
Parameters:
classmethod get_space_info()[source]

Get space type requirements for this policy class.

This class method specifies what types of action and observation spaces this policy implementation can handle, enabling compatibility checking with environments.

Return type:

PolicySpaceInfo

Returns:

PolicySpaceInfo specifying required action and observation space types

Note

Subclasses must implement this method to declare their space compatibility. This is used for validation when pairing policies with environments.