Parabellum environment for parallel warfare simulation
Project description
Parabellum
Parabellum is a research sandbox for experimenting with large-scale, team-based engagements on top of real-world geography. It builds a differentiable JAX environment from OpenStreetMap data, lets you configure arbitrary unit types and combinations, and can render animated replays of each rollout.
Features
- Imports building footprints and basemaps around any geocoded location to ground the simulation in real terrain.
- Supports configurable blue and red team orders of battle, unit capabilities, and sensor ranges via YAML.
- Runs entirely on top of JAX for easy batching, vectorisation, and accelerator support.
- Provides convenience utilities for quantising state to images and exporting GIFs of simulated trajectories.
- Uses
mlxpto manage experiments, making it simple to sweep parameters or override settings from the command-line.
Repository Layout
main.py– entry point that launches simulations, saves trajectories, and writes GIFs.parabellum/– core package with theEnvclass, datatypes, and visualisation helpers.conf/config.yaml– default experiment configuration (location, unit counts, rules, and runtime parameters).logs/,cache/– directories created bymlxpand helper libraries for outputs and cached assets.
Requirements
- Python 3.11 (the project pins
>=3.11,<3.12). - System libraries needed by geospatial packages such as GDAL/PROJ (required by
rasterio,cartopy, andosmnx). - Network access the first time you generate a new map so OpenStreetMap tiles and features can be downloaded.
Installation
The project is set up for uv; a lockfile is included.
# create (or reuse) a virtual environment and install dependencies
uv sync
Running a Simulation
With dependencies installed, run the main entry point. mlxp will load conf/config.yaml by default and create a run directory under logs/.
uv run python main.py
Each execution downloads the requested map (if not cached), simulates the configured number of steps, and stores an animated replay (that optionally overlays unit positions on the base imagery).
To override configuration values from the CLI, append Hydra-style assignments:
uv run python main.py steps=400 sims=4 teams.blu.troop=6
Configuration
All runtime settings live in conf/config.yaml:
- Top-level parameters (
steps,knn,noise, etc.) control simulation length, perception range, and stochasticity. placeandsizedefine the map to fetch from OpenStreetMap and its pixel resolution.teamslists unit counts per type for the blue (blu) and red (red) forces.rulesencodes per-unit attributes such as health, damage, movement speed, and sight radius.
mlxp writes the resolved configuration for each run under logs/, making it straightforward to audit experiments.
Programmatic Use
You can instantiate the environment directly for integration with custom training or evaluation loops:
from omegaconf import OmegaConf
from jax import random
from parabellum import Env
cfg = OmegaConf.load("conf/config.yaml")
env = Env(cfg)
obs, state = env.init(random.PRNGKey(0))
# ... compute actions and call env.step(...) as needed
The Env exposes JAX-native arrays for unit state, making it easy to vectorise across simulations or plug into learning pipelines.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parabellum-0.0.155.tar.gz.
File metadata
- Download URL: parabellum-0.0.155.tar.gz
- Upload date:
- Size: 11.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
755254903e6206947961fb228f9a26e0a745db2068a11ac29dd3ea30283abebf
|
|
| MD5 |
02d3cf9568d8576b350e835f99338c28
|
|
| BLAKE2b-256 |
8194391d64a15a28c0f1fb803e8a7e2f1757dddce4a4961e3a6252a6bcea1b0f
|
File details
Details for the file parabellum-0.0.155-py3-none-any.whl.
File metadata
- Download URL: parabellum-0.0.155-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7d5eb94e3714aa2578a09a5da02e6b75abb313a2f63b1a4bde1d05e55cd59b6
|
|
| MD5 |
55604c08bf198bfd55d4920532af2e12
|
|
| BLAKE2b-256 |
c754a74dc1b9ab816ca280ec39aa6a83eaa88889dc705e60614db2d0b2a0b052
|