The security models live under src/polyhedron_coverage/security/ and support
both 2D polygon targets and 3D cuboid-cell targets.
In this framework:
- Defender: A fleet of drones/trucks patrols subsets of targets within a time budget. The goal is to generate a randomized patrol strategy that minimizes the expected payoff for an attacker.
- Attacker: Chooses a target to intrude, or chooses not to attack. If caught, they pay a penalty; if undetected, they gain a reward.
Detection of an attacker depends on two factors:
- Spatial coverage: 2D games use polygon area and circular drone view radii. 3D games use cuboid volume and spherical drone view radii.
- Temporal overlap: The probability that the patrol window overlaps the attacker's dwell time. Predictable schedules like Greedy allow attackers to avoid patrols, while randomized schedules create genuine uncertainty.
The 2D model uses convex polygon targets generated by the
polyhedron-security-2d CLI.
polyhedron-security-2dOutputs include a 2D target map, profit comparison, visit heatmap, and RL
training curve under output/.
The 3D model uses cuboid cells from the existing coverage3d tessellation
stack. The 3D game preserves the same route/schedule interface as the 2D game,
so Greedy, Random, MaxMin, and RL defenders can be reused.
polyhedron-security-3d --divisions 3 2 1 --days 60 --rl-episodes 500 --make-gifFor a faster smoke run:
polyhedron-security-3d --divisions 2 2 1 --days 4 --rl-episodes 2 --no-gif3D assets:
The strategies/ subpackage includes several defender approaches:
- Greedy: A deterministic strategy choosing the highest-value unvisited targets.
- Maximin (LP): A Linear Programming approach to find the optimal mixed strategy against a rational attacker.
- RL (Reinforcement Learning): Learning optimal routes through trial and error.
- Random: A baseline strategy that randomly selects valid routes.
game_env.py: 2D polygon security game.game_env_3d.py: 3D cuboid-cell security game.coverage_model.py: 2D polygon area and coverage fraction helpers.coverage_model_3d.py: 3D cuboid volume and spherical coverage helpers.visualize_security.py: Shared numeric plots and 2D world map.visualize_security_3d.py: 3D world map and patrol GIF rendering.
polyhedron-security-3d \
--divisions 2 2 1 \
--days 10 \
--rl-episodes 10 \
--make-gif \
--asset-dir docs/assets/security3d \
--output-dir /tmp/polyhedron_security3d_assets
