POMDPPlanners.tests.test_environments.test_pacman_pomdp_beliefs package

Tests for PacMan POMDP belief support.

Submodules

POMDPPlanners.tests.test_environments.test_pacman_pomdp_beliefs.benchmark_pacman_vectorized_belief module

Performance benchmark: PacMan vectorized vs non-vectorized belief.

Run manually to measure speedup:

python -m POMDPPlanners.tests.test_environments.test_pacman_pomdp_beliefs.benchmark_pacman_vectorized_belief

POMDPPlanners.tests.test_environments.test_pacman_pomdp_beliefs.benchmark_pacman_vectorized_belief.main()[source]
Return type:

None

POMDPPlanners.tests.test_environments.test_pacman_pomdp_beliefs.test_pacman_belief_factory module

POMDPPlanners.tests.test_environments.test_pacman_pomdp_beliefs.test_pacman_belief_integration module

POMDPPlanners.tests.test_environments.test_pacman_pomdp_beliefs.test_pacman_grid_utils module

Tests for PacMan grid navigation utility functions.

class POMDPPlanners.tests.test_environments.test_pacman_pomdp_beliefs.test_pacman_grid_utils.TestNeighborTable[source]

Bases: object

test_out_of_bounds_stays()[source]

Test that moving out of bounds keeps position unchanged.

Purpose: Validates boundary handling.

Given: A 5x5 maze. When: Moving North from (0,0) which would go out of bounds. Then: Position stays at (0,0).

Test type: unit

test_valid_move_updates_position()[source]

Test that a valid move correctly updates position.

Purpose: Validates position update for valid moves.

Given: A 5x5 maze. When: Moving South from (0,0). Then: Position updates to (1,0).

Test type: unit

test_wall_blocked_move_stays()[source]

Test that moving into a wall keeps position unchanged.

Purpose: Validates wall collision handling in neighbor table.

Given: A 5x5 maze with a wall at (1,1). When: Looking up a move from (1,0) East (which would go to (1,1)). Then: The result position stays at (1,0).

Test type: unit

class POMDPPlanners.tests.test_environments.test_pacman_pomdp_beliefs.test_pacman_grid_utils.TestNeighborValidity[source]

Bases: object

test_stay_always_valid()[source]

Test that the stay move is always valid.

Purpose: Validates that move index 4 (stay) is always True.

Given: A 5x5 maze. When: Checking validity of stay move for all cells. Then: Stay move (index 4) is True everywhere.

Test type: unit

test_wall_blocked_move_invalid()[source]

Test that moves into walls are marked invalid.

Purpose: Validates wall-blocked moves are False.

Given: A 5x5 maze with a wall at (1,1). When: Checking East move from (1,0). Then: East move is invalid.

Test type: unit

class POMDPPlanners.tests.test_environments.test_pacman_pomdp_beliefs.test_pacman_grid_utils.TestValidCellMask[source]

Bases: object

test_excludes_walls()[source]

Test that wall cells are marked False in the mask.

Purpose: Validates wall cells are excluded from valid mask.

Given: A 5x5 maze with walls at (1,1) and (2,2). When: precompute_valid_cell_mask is called. Then: Wall positions are False, others are True.

Test type: unit

test_shape()[source]

Test output shape matches maze dimensions.

Purpose: Validates output shape correctness.

Given: A 5x5 maze. When: precompute_valid_cell_mask is called. Then: Output shape is (5, 5).

Test type: unit

POMDPPlanners.tests.test_environments.test_pacman_pomdp_beliefs.test_pacman_vectorized_updater module