ssl_simulator
Swarm Systems Lab Python Simulator - a data-oriented (ECS) simulation core for multi-agent robotics research.
All mutable simulation data lives in a World as struct-of-arrays component arrays. Behaviour is
System callables that mutate those arrays in place, vectorized over the N agents. A scheduler
orders systems by their declared reads/writes, and a thin Engine ticks them and logs.
Full documentation is in docs/ - start with architecture and usage.
Installation
Requires Python >= 3.12.
pip install ssl_simulator
Optional extras - pip install ssl_simulator[all] gets everything:
| Extra | What it adds |
|---|---|
lie |
SO(3) state and Lie-group retraction (via lieplusplus) |
fields |
Scalar fields (scipy) |
hdf5 |
HDF5 logging and I/O |
examples |
Dependencies for running examples/ |
Quick example
A swarm of single integrators driven to the origin. A controller is just a system that writes a command component:
import numpy as np
from ssl_simulator import Engine, System, World, load_sim
from ssl_simulator.robot_models import single_integrator
class GoToOrigin(System):
reads, writes = ("p",), ("u",)
def __init__(self, gain):
self.gain = gain
def run(self, world, dt):
world["u"][:] = -self.gain * world["p"] # vectorized over all N agents
world = World(n=5)
integrator = single_integrator(world, state="p", cmd="u",
init=np.random.default_rng(0).random((5, 2)))
world.add_system(GoToOrigin(gain=1.0))
world.add_system(integrator)
Engine(time_step=0.01, log_filename="run.csv", log_time_step=0.1).run(world, duration=5.0)
data, settings = load_sim("run.csv") # logged names are flat: data["p"] -> (T, 5, 2)
Quick Setup (Examples & Development)
Make sure uv and just are installed:
curl -LsSf https://astral.sh/uv/install.sh | sh
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/.local/bin
Both installers add themselves to ~/.local/bin, make sure that's on your PATH.
git clone https://github.com/Swarm-Systems-Lab/ssl_simulator
cd ssl_simulator
# One-command setup (installs ssl-pydev, creates .venv, installs dependencies)
just setup
# Optional: Install all extras for development
just sync
Common tasks - run just --list for the rest:
just test # run the test suite
just lint # ruff format + check
just docs # serve the docs at http://localhost:8000
Examples
See the examples/ directory - it's a guided tour of the ECS core, meant to be read in order.
just example
# Or directly:
uv run python examples/basic_usage.py
Visualization
Visualization lives in the separate ssl_vista package, which reads the logged data directly.
License
MIT
Metadata
Release files for ssl-simulator 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ssl_simulator-1.0.1.tar.gz | 44.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ssl_simulator-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 106.0 kB
Release files / ssl_simulator-1.0.1.tar.gz
| Download URL | ssl_simulator-1.0.1.tar.gz |
|---|---|
| Size | 44.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80ab82d5833d4cd86ba629d227e1c382e36f64c53c65c8bc6ade50665f7ba0fc
|
|
BLAKE2b-256 checksum How to use checksums |
bc962401b9d9fa1807093cf3a2f0afb113bea1b77a1f37c520ad2a440b04b7f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / ssl_simulator-1.0.1-py3-none-any.whl
| Download URL | ssl_simulator-1.0.1-py3-none-any.whl |
|---|---|
| Size | 61.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
674cbeaa2e02f96bf6148ea9be0302a1919ec259a8f54976e79976b1cd240e1a
|
|
BLAKE2b-256 checksum How to use checksums |
6bf27b2715a72953b0cf1337ee2a0a45efdb88842b28acf5ca03a034cffd8358
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|