POMDPPlanners.environments.rock_sample_pomdp.rock_sample_pomdp_beliefs package
RockSample POMDP belief support with vectorized particle filter.
- class POMDPPlanners.environments.rock_sample_pomdp.rock_sample_pomdp_beliefs.RockSampleVectorizedUpdater(map_rows, map_cols, num_rocks, rock_positions, sensor_efficiency)[source]
Bases:
VectorizedParticleBeliefUpdaterVectorized particle belief updater for the RockSample POMDP.
Stores precomputed environment parameters and performs all-particle transitions and observation log-likelihood evaluations using NumPy operations. State layout per particle is
[robot_row, robot_col, rock_0_quality, ..., rock_{R-1}_quality].- Parameters:
- map_rows
Number of grid rows.
- map_cols
Number of grid columns.
- num_rocks
Number of rocks in the environment.
- rock_positions
Array of shape (R, 2) with rock (row, col) positions.
- sensor_efficiency
Sensor noise parameter (higher = less noise).
- batch_observation_log_likelihood(next_particles, action, observation)[source]
Compute observation log-likelihoods for all particles.
- classmethod from_environment(env)[source]
Construct an updater from a RockSamplePOMDP instance.
- Return type:
- Parameters:
env (RockSamplePOMDP)
- POMDPPlanners.environments.rock_sample_pomdp.rock_sample_pomdp_beliefs.create_rocksample_belief(env, belief_type=BeliefType.VECTORIZED_PARTICLE, n_particles=200, **kwargs)[source]
Create a belief object for the RockSample POMDP.
- Parameters:
env (
RockSamplePOMDP) – RockSample environment instance.belief_type (
BeliefType) – Desired belief representation. SupportsPARTICLEandVECTORIZED_PARTICLE.n_particles (
int) – Number of particles. Defaults to 200.**kwargs (
Any) – Reserved for future use.
- Return type:
- Returns:
A configured belief object.
- Raises:
ValueError – If belief_type is not supported.
Submodules
POMDPPlanners.environments.rock_sample_pomdp.rock_sample_pomdp_beliefs.rocksample_belief_factory module
Belief factory for RockSample POMDP.
This module provides a factory function for creating belief objects for the RockSample environment, supporting both standard weighted particle beliefs and vectorized particle beliefs.
- Classes:
- RockSampleVectorizedWeightedParticleBelief: Thin subclass that handles
string-to-integer observation encoding for RockSample.
- Functions:
create_rocksample_belief: Factory returning a configured Belief.
- class POMDPPlanners.environments.rock_sample_pomdp.rock_sample_pomdp_beliefs.rocksample_belief_factory.RockSampleVectorizedWeightedParticleBelief(particles, log_weights, updater, resampling=False, ess_factor=0.5)[source]
Bases:
VectorizedWeightedParticleBeliefVectorized weighted particle belief with string observation encoding.
RockSample observations are strings (
"none","good","bad"), but the parent class expects numeric observations. This subclass transparently encodes string observations to integers before delegating to the vectorized updater.- Parameters:
particles (ndarray)
log_weights (ndarray)
updater (VectorizedParticleBeliefUpdater)
resampling (bool)
ess_factor (float)
- POMDPPlanners.environments.rock_sample_pomdp.rock_sample_pomdp_beliefs.rocksample_belief_factory.create_rocksample_belief(env, belief_type=BeliefType.VECTORIZED_PARTICLE, n_particles=200, **kwargs)[source]
Create a belief object for the RockSample POMDP.
- Parameters:
env (
RockSamplePOMDP) – RockSample environment instance.belief_type (
BeliefType) – Desired belief representation. SupportsPARTICLEandVECTORIZED_PARTICLE.n_particles (
int) – Number of particles. Defaults to 200.**kwargs (
Any) – Reserved for future use.
- Return type:
- Returns:
A configured belief object.
- Raises:
ValueError – If belief_type is not supported.
POMDPPlanners.environments.rock_sample_pomdp.rock_sample_pomdp_beliefs.rocksample_vectorized_updater module
Vectorized particle belief updater for RockSample POMDP.
This module provides a NumPy-vectorized implementation of particle belief updates for the RockSample environment, eliminating Python-level loops over individual particles.
- Classes:
- RockSampleVectorizedUpdater: Batched transition and observation
log-likelihood for RockSample states.
- class POMDPPlanners.environments.rock_sample_pomdp.rock_sample_pomdp_beliefs.rocksample_vectorized_updater.RockSampleVectorizedUpdater(map_rows, map_cols, num_rocks, rock_positions, sensor_efficiency)[source]
Bases:
VectorizedParticleBeliefUpdaterVectorized particle belief updater for the RockSample POMDP.
Stores precomputed environment parameters and performs all-particle transitions and observation log-likelihood evaluations using NumPy operations. State layout per particle is
[robot_row, robot_col, rock_0_quality, ..., rock_{R-1}_quality].- Parameters:
- map_rows
Number of grid rows.
- map_cols
Number of grid columns.
- num_rocks
Number of rocks in the environment.
- rock_positions
Array of shape (R, 2) with rock (row, col) positions.
- sensor_efficiency
Sensor noise parameter (higher = less noise).
- batch_observation_log_likelihood(next_particles, action, observation)[source]
Compute observation log-likelihoods for all particles.
- classmethod from_environment(env)[source]
Construct an updater from a RockSamplePOMDP instance.
- Return type:
- Parameters:
env (RockSamplePOMDP)