This document tracks the state of the SimLab simulation toolkit and the work that remains. Items already shipped are checked; open work is listed below by area.
SimLab currently ships 18 simulators across seven modelling paradigms, exposed
through a Python API, a CLI, a TUI, and a web interface. All simulators share a
BaseSimulation interface and a SimulatorRegistry for dynamic discovery.
Paradigms covered: Basic (discrete-time stochastic), Discrete-event, Statistical / stochastic, Cellular automata, Agent-based, Continuous (system dynamics), Network, plus ecological and domain-specific collections.
- Core module structure with
BaseSimulationabstract class -
SimulatorRegistryfor dynamic discovery and instantiation - Type hinting, parameter validation, and
get_parameters_info()metadata - Reproducible stochastic runs via
random_seed
- Basic: Stock Market, Resource Fluctuations, Product Popularity
- Discrete-event: Discrete Event engine, Queueing (M/M/1, M/M/c)
- Statistical: Monte Carlo, Markov Chain, Gillespie SSA
- Cellular automata: Cellular Automaton, Game of Life (pattern catalogue), Forest Fire (Drossel-Schwabl)
- Agent-based: Agent-Based engine, Boids (Reynolds flocking)
- Continuous: System Dynamics (Euler + RK45)
- Network: processes on random / scale-free / small-world graphs
- Ecological: Predator-Prey (Lotka-Volterra)
- Domain-specific: Epidemiological (SIR), Supply Chain (multi-tier)
- Importable Python package
- CLI (
simlab) with command groups - Terminal UI (
simlab-tui) - Web interface (
simlab-web) - Visualization helpers (
sim_lab.viz)
- MkDocs Material site with per-simulator pages organised by paradigm
- pytest tests for every simulator
- CI workflow (ruff, mypy, pytest)
- PyPI packaging (
sim-lab)
-
SupplyChainSimulation.run_simulation()no longer crashes — addedreset()toSupplyChainNodeand itsFactory/Distributor/Retailersubclasses. -
QueueingSimulation.run_simulation()now processes events — removed the doublereset()that wiped the event queue; the first arrival is scheduled inreset(). -
SystemDynamicsSimulationRK45 path fixed — wrapped the derivative callable soscipy.solve_ivpreceivesfun(t, y)in the correct argument order. - Project-wide rename from the legacy "SimNexus" name to "SimLab" (code, docs, scripts, CI, config).
- Expand CLI coverage: only 7 of 18 simulators have
simlabcommands (stock, resource, product, game-of-life, forest-fire, boids, gillespie). Add commands for the remaining discrete-event, statistical, network, ecological, and domain-specific simulators. - Expose the new simulators (Game of Life, Forest Fire, Boids, Gillespie) in the TUI and web interface.
- Sharable simulation configurations (save/load parameter sets).
-
QueueingSimulation.get_statistics()["server_utilization"]is computed astotal_customers / (max_time * num_servers * service_rate), which approaches(1 - rho) * rhorather than the true utilizationrho. Re-instrument with busy-time tracking so the statistic matches its name. - The codebase uses
typing.Dict/typing.Liststyle throughout; under the project's enabled RuffUPrules these are deprecated in favour ofdict/list. Run a one-offruff check --select UP --fixpass once the formatter is wired into CI. -
AgentBasedSimulation.reset()clears metrics but does not restore agent state; subclasses that need reproducible re-runs (e.g. Boids) override it. Consider pushing a general "snapshot initial agents" mechanism into the base class.
- Add example notebooks for the new simulators (Boids, Gillespie, Forest Fire).
- Property-based / fuzz tests for parameter validation edge cases.
- Performance benchmarks for the larger engines (Network, Supply Chain).
- Docker image for the web interface.
- Cloud-deployment guide.