The Business Prototyping Toolkit for Python — System Dynamics and agent-based modeling in one library, with a compiled Rust engine, a browser runtime and an XMILE compiler.
Keywords

agent-based modeling, system dynamics, python, bptk, bptk-py, sddsl, rust, pyodide, browser, xmile, smile, stella, ithink

Business Prototyping Toolkit

System Dynamics and Agent-based Modeling In Python

The Business Prototyping Toolkit for Python (BPTK-Py) is a computational modeling framework that enables you to build simulation models using System Dynamics (SD) and/or agent-based modeling (ABM) natively in Python and manage simulation scenarios with ease.

The objective of the framework is to let the modeller concentrate on building simulation models, by providing a seamless interface for managing model settings and scenarios and for plotting simulation results.

Models run on a compiled Rust engine where speed matters, and on pure Python everywhere else — including inside a browser. Many pages of this documentation run that way: where a page offers a slider or a dropdown, the plots recompute in front of you, with nothing installed.

Main Features

  • System Dynamics in Python. Build stocks, flows and converters directly in Python with the SD DSL — including multidimensional models.
  • Agent-based and hybrid models. Write agent-based models natively, or combine both techniques in a single hybrid model.
  • A compiled Rust engine. SD models run on a Rust engine that ships pre-compiled inside the wheel — nothing to install, nothing to configure. Choose it per run, per session or per server; anything it cannot express falls back to the Python engine automatically. See Execution Backends.
  • Runs in a browser. BPTK installs into Pyodide and runs on WebAssembly, so a model can be published as a page rather than as a notebook someone has to install first. The Python engine is the one that runs there — see Installation and Limitations.
  • XMILE models become Python. The framework includes a compiler for transpiling System Dynamics models conforming to the XMILE standard into Python code, so a model built in a visual environment such as iseesystems Stella can be used independently in Python.
  • Results are ordinary data. Simulations return Pandas dataframes, plotting is Matplotlib, and model settings and scenarios live in JSON files that the framework loads for you — which makes interactive modeling, coding and testing painless, especially in a reactive notebook environment such as marimo.

Getting Started

The best way to get started with BPTK is to read our Quickstart. You might also like the System Dynamics Tutorial

BPTK was also used to build our implementation of the infamous Beer Distribution Game. Our model library contains simulation models of the Beergame in both System Dynamics and Agent-based versions. It also contains an illustration of how to train reinforcement-learning algorithms to play the Beer Distribution Game.

You can play the game online at beergame.transentis.com

Currently we are working on an Enterprise Digital Twin for transentis. You can find the simulation part of the digital twin in our model library

Getting Help

BPTK-Py is developed and maintained by transentis labs. Currently the main developers are Dr. Oliver Grasl and Markus Bähring, former contributors include Dionysios Basdanis, Ahmed Eldably, Jeremy Funk, David Granzin and Dominik Schröck.

transentis runs online events and trainings on business prototyping throughout the year — the current programme is at academy.transentis.com.

The best place to ask questions about the framework is , we are always happy to help.

Contents

Installation

Quickstart

System Dynamics Tutorial

Concepts

Agent Based Modeling

System Dynamics

Model Library

BPTK API

Limitations

Changelog