POMDPPlanners.planners.mcts_planners package
Subpackages
- POMDPPlanners.planners.mcts_planners.beta_zero package
AbstractBetaZeroNetworkBeliefRepresentationBetaZeroBetaZero.networkBetaZero.belief_representationBetaZero.z_qBetaZero.z_nBetaZero.temperatureBetaZero.action()BetaZero.begin_collecting()BetaZero.buffer_size()BetaZero.collect_episodes_batched()BetaZero.end_collecting()BetaZero.finalize_episode()BetaZero.get_metric_keys()BetaZero.get_network()BetaZero.get_space_info()BetaZero.load_normalization_stats()BetaZero.prepare_episode()BetaZero.save()BetaZero.train_step()
BetaZeroActionSamplerBetaZeroNetworkParticleMeanStdRepresentationTrainingBufferTrainingExample- Submodules
- POMDPPlanners.planners.mcts_planners.beta_zero.belief_representation module
- POMDPPlanners.planners.mcts_planners.beta_zero.beta_zero module
BetaZeroBetaZero.networkBetaZero.belief_representationBetaZero.z_qBetaZero.z_nBetaZero.temperatureBetaZero.action()BetaZero.begin_collecting()BetaZero.buffer_size()BetaZero.collect_episodes_batched()BetaZero.end_collecting()BetaZero.finalize_episode()BetaZero.get_metric_keys()BetaZero.get_network()BetaZero.get_space_info()BetaZero.load_normalization_stats()BetaZero.prepare_episode()BetaZero.save()BetaZero.train_step()
- POMDPPlanners.planners.mcts_planners.beta_zero.beta_zero_action_sampler module
- POMDPPlanners.planners.mcts_planners.beta_zero.beta_zero_network module
- POMDPPlanners.planners.mcts_planners.beta_zero.puct module
- POMDPPlanners.planners.mcts_planners.beta_zero.training module
- POMDPPlanners.planners.mcts_planners.beta_zero.training_buffer module
- POMDPPlanners.planners.mcts_planners.constrained_zero package
ConstrainedTrainingBufferConstrainedTrainingExampleConstrainedTrainingExample.belief_featuresConstrainedTrainingExample.policy_targetConstrainedTrainingExample.value_targetConstrainedTrainingExample.failure_targetConstrainedTrainingExample.belief_featuresConstrainedTrainingExample.failure_targetConstrainedTrainingExample.policy_targetConstrainedTrainingExample.value_target
ConstrainedZeroConstrainedZeroNetwork- Submodules
- POMDPPlanners.planners.mcts_planners.constrained_zero.constrained_puct module
- POMDPPlanners.planners.mcts_planners.constrained_zero.constrained_training module
- POMDPPlanners.planners.mcts_planners.constrained_zero.constrained_training_buffer module
ConstrainedTrainingBufferConstrainedTrainingExampleConstrainedTrainingExample.belief_featuresConstrainedTrainingExample.policy_targetConstrainedTrainingExample.value_targetConstrainedTrainingExample.failure_targetConstrainedTrainingExample.belief_featuresConstrainedTrainingExample.failure_targetConstrainedTrainingExample.policy_targetConstrainedTrainingExample.value_target
- POMDPPlanners.planners.mcts_planners.constrained_zero.constrained_zero module
- POMDPPlanners.planners.mcts_planners.constrained_zero.constrained_zero_network module
Submodules
POMDPPlanners.planners.mcts_planners.constrained_pft_dpw module
C-PFT-DPW (Constrained Particle Filter Tree with Double Progressive Widening).
Online MCTS for cost-constrained POMDPs that uses particle-filter belief
children (PFT-style) under the dual-ascent Lagrangian scaffold from
POMDPPlanners.planners.planners_utils.constrained_mcts_mixin.ConstrainedMCTSMixin.
The shared scaffold implements Listing 1 from Jamgochian et al. (ICAPS
2023); this module supplies only the variant-specific SIMULATE
(Algorithm 2 in the paper) — PFT-DPW’s belief-MDP recursion with
particle-filter belief updates, augmented with a per-belief-child cost
cache and the optional minimal-cost propagation trick.
This is the PFT-DPW counterpart of
POMDPPlanners.planners.mcts_planners.constrained_pomcpow.CPOMCPOW.
References
Jamgochian, A., Corso, A., & Kochenderfer, M. J. (2023). Online Planning for Constrained POMDPs with Continuous Spaces through Dual Ascent. Proceedings of the International Conference on Automated Planning and Scheduling, 33(1), 198-202. https://doi.org/10.1609/icaps.v33i1.27195
- Classes:
CPFT_DPW: Constrained PFT-DPW planner.
- class POMDPPlanners.planners.mcts_planners.constrained_pft_dpw.CPFT_DPW(environment, discount_factor, depth, name, action_sampler, cost_budget, lambda_init=0.0, lambda_step=0.1, return_minimal_cost=True, k_a=1.0, alpha_a=0.5, k_o=1.0, alpha_o=0.5, exploration_constant=1.0, time_out_in_seconds=None, n_simulations=None, min_visit_count_per_action=1, reserve_capacity=0, log_path=None, debug=False, use_queue_logger=False)[source]
Bases:
ConstrainedMCTSMixin,PFT_DPWConstrained PFT-DPW with vector-valued dual ascent.
The Lagrangian / dual-ascent layer lives on
ConstrainedMCTSMixin; this class supplies only the PFT-DPW-specificSIMULATE(Algorithm 2 in the paper) via_simulate_path_with_cost()and its belief-cost helpers, alongside its constructor and a_reset_per_action_stateoverride that also clears the per-belief-child cost cache.- Args mirror
PFT_DPWplus: - environment: A
ConstrainedEnvironment— constraint cost is read via
environment.constraint_cost(s, a, s'). Passing a plainEnvironmentraisesTypeError.- cost_budget: Discounted-cost budget. Scalar or 1-D array of length
K. SeeConstrainedMCTSMixin._validate_and_pack_constraint_params().- lambda_init: Initial Lagrange multiplier per constraint dimension.
Defaults to
0.0.
lambda_step: Dual-ascent step size (> 0). Defaults to
0.1. return_minimal_cost: Enable the minimal-cost propagation trickfrom Jamgochian et al. (2023, Section 4 “Cost backpropagation”). Defaults to
True.- environment: A
- Raises:
TypeError – If
environmentis not aConstrainedEnvironment.ValueError – See
ConstrainedMCTSMixinvalidation rules.
- Parameters:
environment (Environment)
discount_factor (float)
depth (int)
name (str)
action_sampler (ActionSampler)
cost_budget (ndarray)
lambda_init (ndarray)
lambda_step (float)
return_minimal_cost (bool)
k_a (float)
alpha_a (float)
k_o (float)
alpha_o (float)
exploration_constant (float)
time_out_in_seconds (int | None)
n_simulations (int | None)
min_visit_count_per_action (int)
reserve_capacity (int)
log_path (Path | None)
debug (bool)
use_queue_logger (bool)
Notes
Per-belief-child cost is recorded at expansion time and reused on existing-child re-sampling (matches the per-belief-child
(b', r, c)triple semantics of Algorithm 2 line 7 in the paper, generalised to vectorc).Leaf expansion uses a cost-aware random rollout that accumulates
Σ γ^t · constraint_cost(s_t, a_t, s_{t+1}).
- Args mirror
POMDPPlanners.planners.mcts_planners.constrained_pomcpow module
CPOMCPOW (Constrained POMCPOW) Algorithm.
Online MCTS for cost-constrained POMDPs in continuous state, action, and
observation spaces. Composes POMCPOW’s double progressive widening with
the dual-ascent Lagrangian scaffold from
POMDPPlanners.planners.planners_utils.constrained_mcts_mixin.ConstrainedMCTSMixin.
The shared scaffold implements Listing 1 from Jamgochian et al. (ICAPS
2023); this module supplies only the variant-specific SIMULATE
(Algorithm 1 in the paper) — the POMCPOW single-state recursion with
weighted-particle observation widening, augmented with a parallel cost
track and the optional minimal-cost propagation trick.
References
Jamgochian, A., Corso, A., & Kochenderfer, M. J. (2023). Online Planning for Constrained POMDPs with Continuous Spaces through Dual Ascent. Proceedings of the International Conference on Automated Planning and Scheduling, 33(1), 198-202. https://doi.org/10.1609/icaps.v33i1.27195
- Classes:
CPOMCPOW: Constrained POMCPOW planner.
- class POMDPPlanners.planners.mcts_planners.constrained_pomcpow.CPOMCPOW(environment, discount_factor, depth, exploration_constant, k_o, k_a, alpha_o, alpha_a, name, action_sampler, cost_budget, lambda_init=0.0, lambda_step=0.1, return_minimal_cost=True, time_out_in_seconds=None, n_simulations=None, min_visit_count_per_action=1, reserve_capacity=0, log_path=None, debug=False, use_queue_logger=False)[source]
Bases:
ConstrainedMCTSMixin,POMCPOWConstrained POMCPOW with vector-valued dual ascent.
The Lagrangian / dual-ascent layer lives on
ConstrainedMCTSMixin; this class supplies only the POMCPOW-specificSIMULATE(Algorithm 1 in the paper) via_simulate_state_path_with_cost(), alongside its constructor.- Args mirror
POMCPOWplus: - environment: A
ConstrainedEnvironment— constraint cost is read via
environment.constraint_cost(s, a, s'). Passing a plainEnvironmentraisesTypeError.- cost_budget: Discounted-cost budget. Scalar or 1-D array of length
K. SeeConstrainedMCTSMixin._validate_and_pack_constraint_params().- lambda_init: Initial Lagrange multiplier per constraint dimension.
Defaults to
0.0.
lambda_step: Dual-ascent step size (> 0). Defaults to
0.1. return_minimal_cost: Enable the minimal-cost propagation trickfrom Jamgochian et al. (2023, Section 4 “Cost backpropagation”). Defaults to
True.- environment: A
- Raises:
TypeError – If
environmentis not aConstrainedEnvironment.ValueError – See
ConstrainedMCTSMixinvalidation rules.
- Parameters:
environment (Environment)
discount_factor (float)
depth (int)
exploration_constant (float)
k_o (float)
k_a (float)
alpha_o (float)
alpha_a (float)
name (str)
action_sampler (ActionSampler)
cost_budget (ndarray)
lambda_init (ndarray)
lambda_step (float)
return_minimal_cost (bool)
time_out_in_seconds (int | None)
n_simulations (int | None)
min_visit_count_per_action (int)
reserve_capacity (int)
log_path (Path | None)
debug (bool)
use_queue_logger (bool)
Notes
Leaf expansion uses a cost-aware random rollout that accumulates
Σ γ^t · constraint_cost(s_t, a_t, s_{t+1})along the trajectory, so multi-step hazards are reflected in QC backups.- Args mirror
POMDPPlanners.planners.mcts_planners.icvar_pft_dpw module
ICVaR PFT-DPW (Iterated CVaR Particle Filter Tree with Double Progressive Widening) Algorithm.
This module implements a risk-sensitive variant of PFT-DPW that uses the Iterated Conditional Value at Risk (ICVaR) for value backups instead of the expected value. This makes the planner focus on the worst-alpha fraction of outcomes, enabling risk-averse planning in POMDPs.
References
Pariente, Y., & Indelman, V. (2026). Online Risk-Averse Planning in POMDPs Using Iterated CVaR Value Function. arXiv:2601.20554. https://arxiv.org/abs/2601.20554
- Implementation note:
Operates on the column-store arena
POMDPPlanners.core.tree.arena.Tree(integer node IDs, parallel column lists) rather than the legacy anytree-basedBeliefNode/ActionNodegraph. Inherits fromArenaPathSimulationPolicyCostSetting. External constructor signature,action()interface, and behavior are unchanged.- Classes:
ICVaR_PFT_DPW: Risk-sensitive PFT-DPW planner with CVaR-based value updates
- class POMDPPlanners.planners.mcts_planners.icvar_pft_dpw.ICVaR_PFT_DPW(environment, name, depth, action_sampler, discount_factor=0.95, time_out_in_seconds=None, n_simulations=None, alpha=0.1, delta=0.1, belief_child_num=5, min_immediate_cost=0.0, max_immediate_cost=1.0, min_visit_count_per_action=1, exploration_constant=1.0, k_a=1.0, alpha_a=0.5, k_o=1.0, alpha_o=0.5, visit_count_penalty=0.0, reserve_capacity=0)[source]
Bases:
ArenaPathSimulationPolicyCostSettingICVaR PFT-DPW operating on the arena
Tree+ integer node IDs.See module docstring for algorithm details and reference.
- Parameters:
environment (Environment)
name (str)
depth (int)
action_sampler (ActionSampler)
discount_factor (float)
time_out_in_seconds (int | None)
n_simulations (int | None)
alpha (float)
delta (float)
belief_child_num (int)
min_immediate_cost (float)
max_immediate_cost (float)
min_visit_count_per_action (int)
exploration_constant (float)
k_a (float)
alpha_a (float)
k_o (float)
alpha_o (float)
visit_count_penalty (float)
reserve_capacity (int)
- 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:
- 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.
POMDPPlanners.planners.mcts_planners.icvar_pomcpow module
ICVaR POMCPOW (Iterated CVaR POMCPOW) Algorithm.
This module implements a risk-sensitive variant of POMCPOW that uses the Iterated Conditional Value at Risk (ICVaR) for value backups instead of the expected value. This makes the planner focus on the worst-alpha fraction of outcomes, enabling risk-averse planning in POMDPs with continuous state, action, and observation spaces.
References
Pariente, Y., & Indelman, V. (2026). Online Risk-Averse Planning in POMDPs Using Iterated CVaR Value Function. arXiv:2601.20554. https://arxiv.org/abs/2601.20554
- Implementation note:
Operates on the column-store arena
POMDPPlanners.core.tree.arena.Tree(integer node IDs, parallel column lists) rather than the legacy anytree-basedBeliefNode/ActionNodegraph. Inherits fromArenaPathSimulationPolicyCostSetting. External constructor signature,action()interface, and behavior are unchanged.- Classes:
ICVaR_POMCPOW: Risk-sensitive POMCPOW planner with CVaR-based value updates
- class POMDPPlanners.planners.mcts_planners.icvar_pomcpow.ICVaR_POMCPOW(environment, discount_factor, depth, exploration_constant, k_o, k_a, alpha_o, alpha_a, min_immediate_cost, max_immediate_cost, min_visit_count_per_action, delta, name, action_sampler, time_out_in_seconds=None, n_simulations=None, alpha=0.05, min_samples_per_node=10, reserve_capacity=0, log_path=None, debug=False, visit_count_penalty=0.0)[source]
Bases:
ArenaPathSimulationPolicyCostSettingICVaR POMCPOW operating on the arena
Tree+ integer node IDs.See module docstring for algorithm details and reference.
- Parameters:
environment (Environment)
discount_factor (float)
depth (int)
exploration_constant (float)
k_o (float)
k_a (float)
alpha_o (float)
alpha_a (float)
min_immediate_cost (float)
max_immediate_cost (float)
min_visit_count_per_action (int)
delta (float)
name (str)
action_sampler (ActionSampler)
time_out_in_seconds (int | None)
n_simulations (int | None)
alpha (float)
min_samples_per_node (int)
reserve_capacity (int)
log_path (Path | None)
debug (bool)
visit_count_penalty (float)
- 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:
- 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.
POMDPPlanners.planners.mcts_planners.pft_dpw module
PFT-DPW (Particle Filter Tree with Double Progressive Widening) Algorithm.
This module implements PFT-DPW, a Monte Carlo Tree Search algorithm for continuous action spaces in POMDPs. The algorithm uses progressive widening to gradually expand the action and observation spaces during tree search, enabling effective planning in problems with continuous or large discrete action spaces.
Key features: - Progressive widening for both actions and observations - Handles continuous action spaces through adaptive sampling - Uses UCB1-style exploration with progressive expansion - Supports custom action samplers for domain-specific action generation
The algorithm progressively expands the tree by: 1. Using action progressive widening to add new actions based on visit counts 2. Using observation progressive widening to add new observation branches 3. Balancing exploration of new actions with exploitation of promising ones 4. Performing random rollouts from leaf nodes for value estimation
References
Sunberg, Z. N., & Kochenderfer, M. J. (2018). Online Algorithms for POMDPs with Continuous State, Action, and Observation Spaces. Proceedings of the International Conference on Automated Planning and Scheduling, 28(1), 259-263. https://ojs.aaai.org/index.php/ICAPS/article/view/13882
- Implementation note:
This implementation operates on the column-store arena
POMDPPlanners.core.tree.arena.Tree(integer node IDs, parallel column lists) rather than the legacy anytree-basedBeliefNode/ActionNodegraph. Inherits fromArenaDoubleProgressiveWideningMCTSPolicy. The external constructor signature,action()interface, and behavior are unchanged from earlier versions.- Classes:
ActionSampler: Abstract base class for action sampling strategies (re-exported) PFT_DPW: Main PFT-DPW planner with progressive widening for continuous actions
- class POMDPPlanners.planners.mcts_planners.pft_dpw.PFT_DPW(environment, discount_factor, depth, name, action_sampler, k_a=1.0, alpha_a=0.5, k_o=1.0, alpha_o=0.5, exploration_constant=1.0, time_out_in_seconds=None, n_simulations=None, min_visit_count_per_action=1, reserve_capacity=0, log_path=None, debug=False, use_queue_logger=False)[source]
Bases:
ArenaDoubleProgressiveWideningMCTSPolicyPFT-DPW operating on the arena
Tree+ integer node IDs.See module docstring for algorithm details and reference.
Example
>>> import numpy as np >>> from POMDPPlanners.environments.tiger_pomdp import TigerPOMDP >>> from POMDPPlanners.core.belief import get_initial_belief >>> from POMDPPlanners.utils.action_samplers import DiscreteActionSampler >>> np.random.seed(42) >>> >>> tiger = TigerPOMDP(discount_factor=0.95) >>> action_sampler = DiscreteActionSampler(tiger.get_actions()) >>> planner = PFT_DPW( ... environment=tiger, ... discount_factor=0.95, ... depth=5, ... name="ExamplePlanner", ... action_sampler=action_sampler, ... k_a=2.0, ... alpha_a=0.5, ... n_simulations=10 ... ) >>> planner.name 'ExamplePlanner' >>> >>> initial_belief = get_initial_belief(tiger, n_particles=10) >>> actions, run_data = planner.action(initial_belief) >>> >>> space_info = PFT_DPW.get_space_info() >>> space_info.action_space.name 'MIXED'
- Parameters:
environment (Environment)
discount_factor (float)
depth (int)
name (str)
action_sampler (ActionSampler)
k_a (float)
alpha_a (float)
k_o (float)
alpha_o (float)
exploration_constant (float)
time_out_in_seconds (int | None)
n_simulations (int | None)
min_visit_count_per_action (int)
reserve_capacity (int)
log_path (Path | None)
debug (bool)
use_queue_logger (bool)
POMDPPlanners.planners.mcts_planners.pomcp module
POMCP (Partially Observable Monte Carlo Planning) Algorithm Implementation.
This module implements POMCP, a Monte Carlo Tree Search algorithm for POMDP planning. POMCP builds a search tree by iteratively sampling trajectories and using UCB1 for action selection, providing an efficient approximation to optimal POMDP planning.
The algorithm works by: 1. Building a tree of belief-action nodes through Monte Carlo simulations 2. Using UCB1 (Upper Confidence Bounds) for action selection during tree traversal 3. Performing random rollouts from leaf nodes to estimate values 4. Updating node statistics (visit counts, Q-values) based on simulation returns
Key features: - Handles large or continuous observation spaces through particle filtering - Uses UCB1 for principled exploration-exploitation balance - Can be configured with time limits or simulation count limits - Provides theoretical convergence guarantees to optimal policy
References
Silver, D., & Veness, J. (2010). Monte-Carlo Planning in Large POMDPs. Advances in Neural Information Processing Systems, 23. https://papers.nips.cc/paper_files/paper/2010/hash/edfbe1afcf9246bb0d40eb4d8027d90f-Abstract.html
- Implementation note:
This implementation operates on the column-store arena
POMDPPlanners.core.tree.arena.Tree(integer node IDs, parallel column lists) rather than the legacy anytree-basedBeliefNode/ActionNodegraph. Inherits fromArenaPathSimulationPolicy. The external constructor signature,action()interface, and behavior are unchanged from earlier versions.- Classes:
POMCP: Monte Carlo Tree Search planner for POMDPs with UCB1 action selection
- class POMDPPlanners.planners.mcts_planners.pomcp.POMCP(environment, discount_factor, depth, exploration_constant, name, time_out_in_seconds=None, n_simulations=None, reserve_capacity=0, log_path=None, debug=False, use_queue_logger=False)[source]
Bases:
ArenaPathSimulationPolicyPOMCP operating on the arena
Tree+ integer node IDs.See module docstring for algorithm details and reference.
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 = POMCP( ... environment=tiger, ... discount_factor=0.95, ... depth=5, ... exploration_constant=1.0, ... name="ExamplePlanner", ... n_simulations=10 ... ) >>> planner.name 'ExamplePlanner' >>> >>> initial_belief = get_initial_belief(tiger, n_particles=10) >>> actions, run_data = planner.action(initial_belief) >>> >>> space_info = POMCP.get_space_info() >>> space_info.action_space.name 'DISCRETE'
- Parameters:
- get_explored_action_node(tree, belief_id)[source]
Pick an action child via UCB1; if any child has zero visits, pick uniformly from those.
- 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:
- 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.
POMDPPlanners.planners.mcts_planners.pomcp_dpw module
POMCP_DPW (Partially Observable Monte Carlo Planning with Double Progressive Widening) Algorithm.
This module implements POMCP_DPW, an advanced Monte Carlo Tree Search algorithm for POMDP planning that extends POMCP with double progressive widening capabilities. POMCP_DPW combines UCB1 action selection with progressive widening for both actions and observations, making it particularly effective for problems with large or continuous action spaces.
Key features: - Double progressive widening for actions and observations - Unweighted particle-based belief representation (following POMCP tradition) - UCB1-based exploration-exploitation balance - Handles continuous and discrete action spaces - Adaptive observation node expansion
References
Sunberg, Z. N., & Kochenderfer, M. J. (2018). Online Algorithms for POMDPs with Continuous State, Action, and Observation Spaces. Proceedings of the International Conference on Automated Planning and Scheduling, 28(1), 259-263. https://ojs.aaai.org/index.php/ICAPS/article/view/13882
- Implementation note:
This implementation operates on the column-store arena
POMDPPlanners.core.tree.arena.Tree(integer node IDs, parallel column lists) rather than the legacy anytree-basedBeliefNode/ActionNodegraph. Inherits fromArenaDoubleProgressiveWideningMCTSPolicy. The external constructor signature,action()interface, and behavior are unchanged from earlier versions.- Classes:
POMCP_DPW: Monte Carlo Tree Search planner with double progressive widening extending POMCP
- class POMDPPlanners.planners.mcts_planners.pomcp_dpw.POMCP_DPW(environment, discount_factor, depth, exploration_constant, k_o, k_a, alpha_o, alpha_a, name, action_sampler, time_out_in_seconds=None, n_simulations=None, min_visit_count_per_action=1, reserve_capacity=0, log_path=None, debug=False, use_queue_logger=False)[source]
Bases:
ArenaDoubleProgressiveWideningMCTSPolicyPOMCP_DPW operating on the arena
Tree+ integer node IDs.See module docstring for algorithm details and reference.
Example
>>> import numpy as np >>> from POMDPPlanners.environments.tiger_pomdp import TigerPOMDP >>> from POMDPPlanners.core.belief import get_initial_belief >>> from POMDPPlanners.utils.action_samplers import DiscreteActionSampler >>> np.random.seed(42) >>> >>> tiger = TigerPOMDP(discount_factor=0.95) >>> action_sampler = DiscreteActionSampler(tiger.get_actions()) >>> planner = POMCP_DPW( ... environment=tiger, ... discount_factor=0.95, ... depth=5, ... exploration_constant=1.0, ... k_o=3.0, ... k_a=3.0, ... alpha_o=0.5, ... alpha_a=0.5, ... action_sampler=action_sampler, ... 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 = POMCP_DPW.get_space_info() >>> space_info.action_space.name 'MIXED'
- Parameters:
environment (Environment)
discount_factor (float)
depth (int)
exploration_constant (float)
k_o (float)
k_a (float)
alpha_o (float)
alpha_a (float)
name (str)
action_sampler (ActionSampler)
time_out_in_seconds (int | None)
n_simulations (int | None)
min_visit_count_per_action (int)
reserve_capacity (int)
log_path (Path | None)
debug (bool)
use_queue_logger (bool)
POMDPPlanners.planners.mcts_planners.pomcpow module
POMCPOW (Partially Observable Monte Carlo Planning with Optimistic Weights) Algorithm.
This module implements POMCPOW, an advanced Monte Carlo Tree Search algorithm for POMDP planning that extends POMCP with double progressive widening capabilities. POMCPOW combines UCB1 action selection with progressive widening for both actions and observations, making it particularly effective for problems with large or continuous action spaces.
Key features: - Double progressive widening for actions and observations - Weighted particle-based belief representation - UCB1-based exploration-exploitation balance - Handles continuous and discrete action spaces - Adaptive observation node expansion
The algorithm progressively expands the tree by: 1. Using action progressive widening to add new actions based on visit counts and α_a parameter 2. Using observation progressive widening to add new observation branches based on k_o and α_o 3. Maintaining weighted particle beliefs in observation nodes 4. Balancing exploration of new actions with exploitation of promising ones 5. Performing random rollouts from leaf nodes for value estimation
References
Sunberg, Z. N., & Kochenderfer, M. J. (2018). Online Algorithms for POMDPs with Continuous State, Action, and Observation Spaces. Proceedings of the International Conference on Automated Planning and Scheduling, 28(1), 259-263. https://ojs.aaai.org/index.php/ICAPS/article/view/13882
- Implementation note:
This implementation operates on the column-store arena
POMDPPlanners.core.tree.arena.Tree(integer node IDs, parallel column lists) rather than the legacy anytree-basedBeliefNode/ActionNodegraph. Inherits fromArenaDoubleProgressiveWideningMCTSPolicy. The external constructor signature,action()interface, and behavior are unchanged from earlier versions.- Classes:
POMCPOW: Monte Carlo Tree Search planner with double progressive widening
- class POMDPPlanners.planners.mcts_planners.pomcpow.POMCPOW(environment, discount_factor, depth, exploration_constant, k_o, k_a, alpha_o, alpha_a, name, action_sampler, time_out_in_seconds=None, n_simulations=None, min_visit_count_per_action=1, reserve_capacity=0, log_path=None, debug=False, use_queue_logger=False)[source]
Bases:
ArenaDoubleProgressiveWideningMCTSPolicyPOMCPOW operating on the arena
Tree+ integer node IDs.See module docstring for algorithm details and reference.
Example
>>> import numpy as np >>> from POMDPPlanners.environments.tiger_pomdp import TigerPOMDP >>> from POMDPPlanners.core.belief import get_initial_belief >>> from POMDPPlanners.utils.action_samplers import DiscreteActionSampler >>> np.random.seed(42) >>> >>> tiger = TigerPOMDP(discount_factor=0.95) >>> action_sampler = DiscreteActionSampler(tiger.get_actions()) >>> planner = POMCPOW( ... environment=tiger, ... discount_factor=0.95, ... depth=5, ... exploration_constant=1.0, ... k_o=3.0, ... k_a=3.0, ... alpha_o=0.5, ... alpha_a=0.5, ... action_sampler=action_sampler, ... n_simulations=10, ... name="ExamplePlanner" ... ) >>> planner.name 'ExamplePlanner' >>> >>> initial_belief = get_initial_belief(tiger, n_particles=10) >>> actions, run_data = planner.action(initial_belief)
- Parameters:
environment (Environment)
discount_factor (float)
depth (int)
exploration_constant (float)
k_o (float)
k_a (float)
alpha_o (float)
alpha_a (float)
name (str)
action_sampler (ActionSampler)
time_out_in_seconds (int | None)
n_simulations (int | None)
min_visit_count_per_action (int)
reserve_capacity (int)
log_path (Path | None)
debug (bool)
use_queue_logger (bool)
POMDPPlanners.planners.mcts_planners.sparse_pft module
Sparse-PFT (Sparse Particle Filter Tree) Algorithm for POMDP Planning.
- Implementation note:
Operates on the column-store arena
POMDPPlanners.core.tree.arena.Tree(integer node IDs, parallel column lists) rather than the legacy anytree-basedBeliefNode/ActionNodegraph. Inherits fromArenaPathSimulationPolicy. External constructor signature,action()interface, and behavior are unchanged.
- 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:
ArenaPathSimulationPolicySparse-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:
- 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.