POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs package

class POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs.ContinuousLaserTagVectorizedUpdater(walls, grid_size, robot_radius, opponent_radius, tag_radius, pursuit_speed, measurement_noise, robot_L00, robot_L10, robot_L11, opponent_L00, opponent_L10, opponent_L11, action_to_vector=None)[source]

Bases: VectorizedParticleBeliefUpdater

Vectorized particle belief updater for the Continuous LaserTag POMDP.

Performs all-particle transitions and observation log-likelihood evaluations using vectorized NumPy operations. Pre-computed Cholesky scalars for 2-D noise enable fast sampling without per-particle calls.

Parameters:
  • walls (np.ndarray)

  • grid_size (np.ndarray)

  • robot_radius (float)

  • opponent_radius (float)

  • tag_radius (float)

  • pursuit_speed (float)

  • measurement_noise (float)

  • robot_L00 (float)

  • robot_L10 (float)

  • robot_L11 (float)

  • opponent_L00 (float)

  • opponent_L10 (float)

  • opponent_L11 (float)

  • action_to_vector (Optional[Dict[str, np.ndarray]])

walls

Shape (M, 4) wall AABB array.

grid_size

Shape (2,) arena dimensions.

robot_radius

Robot body radius.

opponent_radius

Opponent body radius.

tag_radius

Maximum tag distance.

pursuit_speed

Mean opponent pursuit step magnitude.

measurement_noise

Laser measurement noise std.

Example

>>> import numpy as np
>>> np.random.seed(42)
>>> from POMDPPlanners.environments.laser_tag_pomdp.continuous_laser_tag_pomdp import (
...     ContinuousLaserTagPOMDP,
... )
>>> env = ContinuousLaserTagPOMDP(discount_factor=0.95)
>>> updater = ContinuousLaserTagVectorizedUpdater.from_environment(env)
>>> state = env.initial_state_dist().sample()[0]
>>> particles = np.tile(state, (50, 1))
>>> action = np.array([1.0, 0.0, 0.0])
>>> next_p = updater.batch_transition(particles, action)
>>> next_p.shape[1]
5
>>> obs = env.observation_model(state, action).sample()[0]
>>> ll = updater.batch_observation_log_likelihood(next_p, action, obs)
>>> ll.shape[0]
50
batch_observation_log_likelihood(next_particles, action, observation)[source]

Compute observation log-likelihoods for all particles at once.

Parameters:
  • next_particles (ndarray) – Transitioned particle states of shape (N, d).

  • action (ndarray) – Action vector.

  • observation (ndarray) – Observed value.

Return type:

ndarray

Returns:

Log-likelihoods of shape (N,).

batch_transition(particles, action)[source]

Transition all particles in a single batched operation.

Parameters:
  • particles (ndarray) – Current particle states of shape (N, d).

  • action (ndarray) – Action vector.

Return type:

ndarray

Returns:

Next-state particles of shape (N, d).

property config_id: str

Return a deterministic identifier for this updater configuration.

classmethod from_environment(env)[source]

Construct an updater from a ContinuousLaserTagPOMDP instance.

Parameters:

env (ContinuousLaserTagPOMDP) – Environment to extract parameters from.

Return type:

ContinuousLaserTagVectorizedUpdater

Returns:

A new ContinuousLaserTagVectorizedUpdater instance.

class POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs.LaserTagVectorizedUpdater(floor_shape, valid_cell, wall_dist_table, measurement_noise, transition_error_prob)[source]

Bases: VectorizedParticleBeliefUpdater

Vectorized particle belief updater for the LaserTag POMDP.

Performs all-particle transitions and observation log-likelihood evaluations using vectorized NumPy operations. Precomputed lookup tables for wall distances and valid cells replace per-ray Python loops at update time.

Parameters:
  • floor_shape (Tuple[int, int])

  • valid_cell (np.ndarray)

  • wall_dist_table (np.ndarray)

  • measurement_noise (float)

  • transition_error_prob (float)

floor_shape

Grid dimensions as (rows, cols).

valid_cell

Boolean array of shape (rows, cols).

wall_dist_table

Integer array of shape (rows, cols, 8).

measurement_noise

Standard deviation of laser measurement noise.

transition_error_prob

Probability of executing a random movement.

Example

>>> import numpy as np
>>> np.random.seed(42)
>>> from POMDPPlanners.environments.laser_tag_pomdp import LaserTagPOMDP
>>> env = LaserTagPOMDP(discount_factor=0.95)
>>> updater = LaserTagVectorizedUpdater.from_environment(env)
>>> state = env.initial_state_dist().sample()[0]
>>> particles = np.tile(state, (50, 1))
>>> action = 0  # North
>>> next_p = updater.batch_transition(particles, action)
>>> next_p.shape[1]
5
>>> obs = env.observation_model(state, action).sample()[0]
>>> obs_arr = np.array(obs, dtype=float)
>>> ll = updater.batch_observation_log_likelihood(next_p, action, obs_arr)
>>> ll.shape[0]
50
batch_observation_log_likelihood(next_particles, action, observation)[source]

Compute observation log-likelihoods for all particles at once.

Parameters:
  • next_particles (ndarray) – Transitioned particle states of shape (N, d).

  • action (ndarray) – Action vector.

  • observation (ndarray) – Observed value.

Return type:

ndarray

Returns:

Log-likelihoods of shape (N,).

batch_transition(particles, action)[source]

Transition all particles in a single batched operation.

Parameters:
  • particles (ndarray) – Current particle states of shape (N, d).

  • action (ndarray) – Action vector.

Return type:

ndarray

Returns:

Next-state particles of shape (N, d).

property config_id: str

Return a deterministic identifier for this updater configuration.

classmethod from_environment(env)[source]

Construct an updater from a LaserTagPOMDP instance.

Parameters:

env (LaserTagPOMDP) – Environment to extract parameters from.

Return type:

LaserTagVectorizedUpdater

Returns:

A new LaserTagVectorizedUpdater instance.

POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs.create_continuous_laser_tag_belief(env, belief_type=BeliefType.VECTORIZED_PARTICLE, n_particles=200)[source]

Create a ready-to-use belief for the Continuous LaserTag POMDP.

Parameters:
  • env (ContinuousLaserTagPOMDP) – ContinuousLaserTagPOMDP (or discrete-action variant) instance.

  • belief_type (BeliefType) – Desired belief representation. Defaults to BeliefType.VECTORIZED_PARTICLE.

  • n_particles (int) – Number of particles. Defaults to 200.

Return type:

Belief

Returns:

A configured Belief object.

Raises:

ValueError – If belief_type is not supported.

POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs.create_laser_tag_belief(env, belief_type=BeliefType.VECTORIZED_PARTICLE, n_particles=200)[source]

Create a ready-to-use belief for the LaserTag POMDP.

Parameters:
  • env (LaserTagPOMDP) – LaserTagPOMDP environment instance.

  • belief_type (BeliefType) – Desired belief representation. Defaults to BeliefType.VECTORIZED_PARTICLE.

  • n_particles (int) – Number of particles. Defaults to 200.

Return type:

Belief

Returns:

A configured Belief object.

Raises:

ValueError – If belief_type is not supported.

Submodules

POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs.continuous_laser_tag_belief_factory module

Belief factory for the Continuous LaserTag POMDP.

Functions:
create_continuous_laser_tag_belief: Factory producing a configured

belief for ContinuousLaserTagPOMDP or its discrete-action variant.

POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs.continuous_laser_tag_belief_factory.create_continuous_laser_tag_belief(env, belief_type=BeliefType.VECTORIZED_PARTICLE, n_particles=200)[source]

Create a ready-to-use belief for the Continuous LaserTag POMDP.

Parameters:
  • env (ContinuousLaserTagPOMDP) – ContinuousLaserTagPOMDP (or discrete-action variant) instance.

  • belief_type (BeliefType) – Desired belief representation. Defaults to BeliefType.VECTORIZED_PARTICLE.

  • n_particles (int) – Number of particles. Defaults to 200.

Return type:

Belief

Returns:

A configured Belief object.

Raises:

ValueError – If belief_type is not supported.

POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs.continuous_laser_tag_vectorized_updater module

Vectorized particle belief updater for the Continuous LaserTag POMDP.

This module implements a concrete VectorizedParticleBeliefUpdater that performs batched state transitions and observation log-likelihood evaluations for the Continuous LaserTag environment, replacing per-particle Python loops with NumPy array operations where possible.

Pre-computed Cholesky scalars for the 2-D robot and opponent transition noise enable fast vectorized sampling, mirroring the approach used by the Continuous Light-Dark vectorized updater.

Classes:
ContinuousLaserTagVectorizedUpdater: Batched updater for the

Continuous LaserTag POMDP.

class POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs.continuous_laser_tag_vectorized_updater.ContinuousLaserTagVectorizedUpdater(walls, grid_size, robot_radius, opponent_radius, tag_radius, pursuit_speed, measurement_noise, robot_L00, robot_L10, robot_L11, opponent_L00, opponent_L10, opponent_L11, action_to_vector=None)[source]

Bases: VectorizedParticleBeliefUpdater

Vectorized particle belief updater for the Continuous LaserTag POMDP.

Performs all-particle transitions and observation log-likelihood evaluations using vectorized NumPy operations. Pre-computed Cholesky scalars for 2-D noise enable fast sampling without per-particle calls.

Parameters:
  • walls (np.ndarray)

  • grid_size (np.ndarray)

  • robot_radius (float)

  • opponent_radius (float)

  • tag_radius (float)

  • pursuit_speed (float)

  • measurement_noise (float)

  • robot_L00 (float)

  • robot_L10 (float)

  • robot_L11 (float)

  • opponent_L00 (float)

  • opponent_L10 (float)

  • opponent_L11 (float)

  • action_to_vector (Optional[Dict[str, np.ndarray]])

walls

Shape (M, 4) wall AABB array.

grid_size

Shape (2,) arena dimensions.

robot_radius

Robot body radius.

opponent_radius

Opponent body radius.

tag_radius

Maximum tag distance.

pursuit_speed

Mean opponent pursuit step magnitude.

measurement_noise

Laser measurement noise std.

Example

>>> import numpy as np
>>> np.random.seed(42)
>>> from POMDPPlanners.environments.laser_tag_pomdp.continuous_laser_tag_pomdp import (
...     ContinuousLaserTagPOMDP,
... )
>>> env = ContinuousLaserTagPOMDP(discount_factor=0.95)
>>> updater = ContinuousLaserTagVectorizedUpdater.from_environment(env)
>>> state = env.initial_state_dist().sample()[0]
>>> particles = np.tile(state, (50, 1))
>>> action = np.array([1.0, 0.0, 0.0])
>>> next_p = updater.batch_transition(particles, action)
>>> next_p.shape[1]
5
>>> obs = env.observation_model(state, action).sample()[0]
>>> ll = updater.batch_observation_log_likelihood(next_p, action, obs)
>>> ll.shape[0]
50
batch_observation_log_likelihood(next_particles, action, observation)[source]

Compute observation log-likelihoods for all particles at once.

Parameters:
  • next_particles (ndarray) – Transitioned particle states of shape (N, d).

  • action (ndarray) – Action vector.

  • observation (ndarray) – Observed value.

Return type:

ndarray

Returns:

Log-likelihoods of shape (N,).

batch_transition(particles, action)[source]

Transition all particles in a single batched operation.

Parameters:
  • particles (ndarray) – Current particle states of shape (N, d).

  • action (ndarray) – Action vector.

Return type:

ndarray

Returns:

Next-state particles of shape (N, d).

property config_id: str

Return a deterministic identifier for this updater configuration.

classmethod from_environment(env)[source]

Construct an updater from a ContinuousLaserTagPOMDP instance.

Parameters:

env (ContinuousLaserTagPOMDP) – Environment to extract parameters from.

Return type:

ContinuousLaserTagVectorizedUpdater

Returns:

A new ContinuousLaserTagVectorizedUpdater instance.

POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs.laser_tag_belief_factory module

Belief factory for the LaserTag POMDP.

Functions:

create_laser_tag_belief: Factory producing a configured belief for LaserTagPOMDP.

POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs.laser_tag_belief_factory.create_laser_tag_belief(env, belief_type=BeliefType.VECTORIZED_PARTICLE, n_particles=200)[source]

Create a ready-to-use belief for the LaserTag POMDP.

Parameters:
  • env (LaserTagPOMDP) – LaserTagPOMDP environment instance.

  • belief_type (BeliefType) – Desired belief representation. Defaults to BeliefType.VECTORIZED_PARTICLE.

  • n_particles (int) – Number of particles. Defaults to 200.

Return type:

Belief

Returns:

A configured Belief object.

Raises:

ValueError – If belief_type is not supported.

POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs.laser_tag_vectorized_updater module

Vectorized particle belief updater for the LaserTag POMDP.

This module implements a concrete VectorizedParticleBeliefUpdater that performs batched state transitions and observation log-likelihood evaluations for the LaserTag environment, replacing per-particle Python loops with NumPy array operations.

Wall-distance lookup tables are precomputed once at construction time so that laser measurements and collision checks use fast array indexing rather than per-ray Python loops at update time.

Classes:

LaserTagVectorizedUpdater: Batched updater for the LaserTag POMDP.

class POMDPPlanners.environments.laser_tag_pomdp.laser_tag_pomdp_beliefs.laser_tag_vectorized_updater.LaserTagVectorizedUpdater(floor_shape, valid_cell, wall_dist_table, measurement_noise, transition_error_prob)[source]

Bases: VectorizedParticleBeliefUpdater

Vectorized particle belief updater for the LaserTag POMDP.

Performs all-particle transitions and observation log-likelihood evaluations using vectorized NumPy operations. Precomputed lookup tables for wall distances and valid cells replace per-ray Python loops at update time.

Parameters:
  • floor_shape (Tuple[int, int])

  • valid_cell (np.ndarray)

  • wall_dist_table (np.ndarray)

  • measurement_noise (float)

  • transition_error_prob (float)

floor_shape

Grid dimensions as (rows, cols).

valid_cell

Boolean array of shape (rows, cols).

wall_dist_table

Integer array of shape (rows, cols, 8).

measurement_noise

Standard deviation of laser measurement noise.

transition_error_prob

Probability of executing a random movement.

Example

>>> import numpy as np
>>> np.random.seed(42)
>>> from POMDPPlanners.environments.laser_tag_pomdp import LaserTagPOMDP
>>> env = LaserTagPOMDP(discount_factor=0.95)
>>> updater = LaserTagVectorizedUpdater.from_environment(env)
>>> state = env.initial_state_dist().sample()[0]
>>> particles = np.tile(state, (50, 1))
>>> action = 0  # North
>>> next_p = updater.batch_transition(particles, action)
>>> next_p.shape[1]
5
>>> obs = env.observation_model(state, action).sample()[0]
>>> obs_arr = np.array(obs, dtype=float)
>>> ll = updater.batch_observation_log_likelihood(next_p, action, obs_arr)
>>> ll.shape[0]
50
batch_observation_log_likelihood(next_particles, action, observation)[source]

Compute observation log-likelihoods for all particles at once.

Parameters:
  • next_particles (ndarray) – Transitioned particle states of shape (N, d).

  • action (ndarray) – Action vector.

  • observation (ndarray) – Observed value.

Return type:

ndarray

Returns:

Log-likelihoods of shape (N,).

batch_transition(particles, action)[source]

Transition all particles in a single batched operation.

Parameters:
  • particles (ndarray) – Current particle states of shape (N, d).

  • action (ndarray) – Action vector.

Return type:

ndarray

Returns:

Next-state particles of shape (N, d).

property config_id: str

Return a deterministic identifier for this updater configuration.

classmethod from_environment(env)[source]

Construct an updater from a LaserTagPOMDP instance.

Parameters:

env (LaserTagPOMDP) – Environment to extract parameters from.

Return type:

LaserTagVectorizedUpdater

Returns:

A new LaserTagVectorizedUpdater instance.