# Arbitration Graphs
[](https://github.com/KIT-MRT/arbitration_graphs/releases)
[](./LICENSE)
[](https://github.com/KIT-MRT/arbitration_graphs/actions/workflows/run-unit-tests.yaml?query=branch%3Amain)
*TL;DR: Replace those rusty state machines with safe and scalable arbitration graphs!*
**Hierarchical behavior models for complex decision-making and behavior generation in robotics!**
- 🌱 **Bottom-up**
Combine simple atomic behavior components to generate complex behaviors.
- 🧩 **Functional decomposition**
Behavior components address *How to do it?* and *Can we do it?*, while Arbitrators decide *What to do?*
- 🧠 **Meta-framework**
Integrate diverse methods in one decision-making framework. Why not combine optimization-based planning, probabilistic approaches (POMDPs), and machine learning (RL)? Use any approach where it performs best!
- 🛠️ **Maintainability**
Add new behaviors without having to touch existing ones – did we mention strict modularity and functional decomposition?
- 🛡️ **Behavior Verification**
Use tightly integrated verifiers to ensure that only safe and valid behavior commands are executed.
- 🪂 **Graceful Degradation**
Your behavior is unreliable or unsafe? Arbitrators will gracefully fall back to the next-best option.
<details>
<summary>😋 Click for more reasons!</summary>
- 📈 **Scalability**
Stack behavior components in arbitrators to create hierarchical behavior models.
- 💡 **Transparency**
Easily follow and understand the decision-making process, e.g., with our GUI.
- 📦 **Header-Only**
Simple integration – just include this header-only C++17 library!
- 🐍 **Python Bindings**
For easy prototyping, testing, and integration of machine learning algorithms, all the functionality is available via Python bindings.
- 📜 **Permissive License**
Published under MIT license to ensure maximum flexibility for your projects.
</details>
<details>
<summary>🤨 How does it compare to Behavior Trees?</summary>
Behavior Trees (BTs) are great for a variety of applications and thrive within a vibrant community!
Kudos to [Petter Ögren's](https://www.kth.se/profile/petter/) crew, [Michele Colledanchise](https://miccol.github.io/behaviortrees/) and [Davide Faconti](https://github.com/facontidavide) 🖖
But, Arbitration Graphs bring great value, especially for safety critical applications like self-driving cars and mobile robots in general – by strictly coupling preconditions to behaviors and tightly integrating behavior verification.
A bit more in detail:
| | Behavior Trees | Arbitration Graphs |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Interfaces** | Nodes return execution status (*success*, *failure*, or *running*). <br>⏵ more flexibility w.r.t. a node's actuator interfaces | Behavior components & arbitrators return commands (e.g., a trajectory). <br>⏵ control theory motivated interface ${f(\boldsymbol{x}) \to \boldsymbol{u}}$ <br>⏵ command can be verified by each arbitrator |
| **Preconditions** | Implemented by condition nodes distributed throughout the tree. <br>⏵ easy to reuse preconditions for multiple behaviors | Require behavior components to define their own preconditions. <br>⏵ tight coupling of preconditions to behaviors <br>⏵ robustness and safety less dependent on node arrangement |
| **Safety** | Each node decides on its success or failure. <br>⏵ can lead to safety and reliability issues, if not carefully managed | Integrate safety into the selection mechanism, using node-independent verifiers. <br>⏵ reduces the burden on behavior engineers <br>⏵ allows an easy integration of unsafe behavior components (ML, probabilistic, …) |
</details>
## At a Glance
**Arbitration Graphs** break down complex decision-making into atomic behavior components and arbitrators.
**Behavior components** compute a command (e.g., a trajectory) based on the current state of the world.
They define whether they can be executed in the current state using their invocation condition.
**Arbitrators** select the best option based on a defined decision-making policy.
Options can be behavior components or nested arbitrators.
**Verifiers** check whether the command of a behavior component is safe and valid prior to being selected by an arbitrator.
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/arbitration_graphs_at_a_glance_dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/arbitration_graphs_at_a_glance_light.svg">
<img src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/arbitration_graphs_at_a_glance_light.svg">
</picture>
</p>
## Demo
We provide a demo of this library using Pac-Man as an example application.
The arbitration graph controls Pac-Man on its journey to collect tasty dots 🍬
Run the demo with:
```bash
git clone https://github.com/KIT-MRT/arbitration_graphs.git
cd arbitration_graphs/demo
docker compose up
```
Open the GUI with your favorite browser:
[http://0.0.0.0:8080](http://0.0.0.0:8080)
### Explanation
You will see the *Pacman Agent* arbitrator selecting between five behavior options (by priority).
The *Eat Dots* option is itself an arbitrator with two sub-behaviors (selecting by expected benefit).
In this scene,
- the *Chase Ghost* and *Avoid Ghost* behaviors are not applicable (no ghosts in close vicinity) → grey background,
- the *Eat Closest Dot* and *Move Randomly* behavior failed verification (our verification showcase) → red background,
- thus, the least-prioritized *Stay in Place* behavior is being executed → green background.
<p align="center">
<img src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/pacman_scenario_cropped.png" width="300" />
</p>
<p align="center">
<img src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/pacman_arbitrator_safe.svg" width="500" />
</p>
## Installation
> **Note:** We are currently working on a new major release of the library which will include some breaking changes.
> See the corresponding [issue](https://github.com/KIT-MRT/arbitration_graphs/issues/116) and [pull request](https://github.com/KIT-MRT/arbitration_graphs/pull/123) for details and the current status.
The Python interface to the arbitration graph library is generated using `pybind11` and provides a convenient interface to utilize the full power of the arbitration graph library in Python.
### Via PyPI (Recommended)
Even more good news: The package is available on PyPI, so installing it is as easy as running:
```bash
pip install arbitration-graphs
```
> **Note:** The package requires Python 3.8 or higher and currently only supports a limited set of platforms.
> Let us know if you need support for an additional platform and we will see what we can do!
### From Source
You can also build the package from source.
Handy for development or if your target platform is currently not supported by the pre-built package.
<details>
<summary>Prerequisites</summary>
First make sure all dependencies are installed:
- The arbitration graph core library (see [../README.md](../README.md))
- Python 3.8 or higher
- [ninja](https://ninja-build.org/)
See also the [`Dockerfile`](./Dockerfile) for how to install these packages under Debian or Ubuntu.
</details>
<details>
<summary>Via pip</summary>
```bash
# From local repository
git clone https://github.com/KIT-MRT/arbitration_graphs.git
cd arbitration_graphs/python_bindings
pip install .
# Or directly from GitHub
pip install git+https://github.com/KIT-MRT/arbitration_graphs.git#subdirectory=python_bindings
```
</details>
<details>
<summary>Via CMake</summary>
Clone the repository and build the package using CMake:
```bash
mkdir -p arbitration_graphs/python_bindings/build
cd arbitration_graphs/python_bindings/build
cmake ..
cmake --build .
```
</details>
## Development
<details>
<summary>Using Docker image</summary>
Clone the repository and run the development image
```bash
git clone https://github.com/KIT-MRT/arbitration_graphs.git
cd arbitration_graphs/python_bindings
docker compose build arbitration_graphs_pybind_devel
docker compose run --rm arbitration_graphs_pybind_devel
```
This mounts the source into the container's `/home/blinky/arbitration_graphs` folder.
There, you can edit the source code, compile and run the tests etc.
</details>
<details>
<summary>Running unit tests</summary>
This package includes unit tests analogous to the C++ tests.
To run all tests, use the following command:
```bash
cd arbitration_graphs/python_bindings/test
python -m unittest discover
```
</details>
## Contributors
This library and repo has been crafted with ❤️ by
**Christoph Burger**
<span>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark-white.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg">
<img height="16" class="github-logo" src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg" alt="GitHub Invertocat"/>
</picture>
<a href="https://github.com/ChristophBurger89" aria-label="View GitHub profile">
ChristophBurger89
</a>
<img height="16" style="height:1em; position: relative; top:.2em" src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/In-Blue-128@2x.png" alt="LinkedIn logo"/>
<a href="https://www.linkedin.com/in/christoph-burger" aria-label="View LinkedIn profile">
christoph-burger
</a>
<img height="16" style="height:1em; position: relative; top:.2em" src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/ORCID-iD_icon_vector.svg" alt="ORCID iD"/>
<a href="https://orcid.org/0009-0002-9147-8749" aria-label="View ORCID record">
0009-0002-9147-8749
</a>
</span>
<br>
**Nick Le Large**
<span>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark-white.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg">
<img height="16" class="github-logo" src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg" alt="GitHub Invertocat"/>
</picture>
<a href="https://github.com/ll-nick" aria-label="View GitHub profile">
ll-nick
</a>
<img height="16" style="height:1em; position: relative; top:.2em" src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/In-Blue-128@2x.png" alt="LinkedIn logo"/>
<a href="https://www.linkedin.com/in/nick-le-large" aria-label="View LinkedIn profile">
nick-le-large
</a>
<img height="16" style="height:1em; position: relative; top:.2em" src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/ORCID-iD_icon_vector.svg" alt="ORCID iD"/>
<a href="https://orcid.org/0009-0006-5191-9043" aria-label="View ORCID record">
0009-0006-5191-9043
</a>
</span>
<br>
**Piotr Spieker**
<span>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark-white.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg">
<img height="16" class="github-logo" src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg" alt="GitHub Invertocat"/>
</picture>
<a href="https://github.com/orzechow" aria-label="View GitHub profile">
orzechow
</a>
<img height="16" style="height:1em; position: relative; top:.2em" src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/In-Blue-128@2x.png" alt="LinkedIn logo"/>
<a href="https://www.linkedin.com/in/piotr-spieker" aria-label="View LinkedIn profile">
piotr-spieker
</a>
<img height="16" style="height:1em; position: relative; top:.2em" src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/ORCID-iD_icon_vector.svg" alt="ORCID iD"/>
<a href="https://orcid.org/0000-0002-0449-3741" aria-label="View ORCID record">
0000-0002-0449-3741
</a>
</span>
Christoph and Piotr coded the core in a pair-programming session.
Piotr also contributed the GUI and GitHub Page.
Nick implemented the awesome PacMan demo and tutorial, with drafting support by Christoph, reviews and finetuning by Piotr.
The Python bindings have been contributed by Nick and reviewed by Piotr.
The repository is maintained by Piotr Spieker
<span>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark-white.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg">
<img height="16" class="github-logo" src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg" alt="GitHub Invertocat"/>
</picture>
<a href="https://github.com/orzechow" aria-label="View GitHub profile">
orzechow
</a>
</span>
and
Nick Le Large
<span>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark-white.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg">
<img height="16" class="github-logo" src="https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg" alt="GitHub Invertocat"/>
</picture>
<a href="https://github.com/ll-nick" aria-label="View GitHub profile">
ll-nick
</a>
</span>.
## Citation
If you use arbitration graphs in your research, we would be pleased if you cite our work:
*Piotr Spieker, Nick Le Large, and Martin Lauer, “Better Safe Than Sorry: Enhancing Arbitration Graphs for Safe and Robust Autonomous Decision-Making,” Nov. 15, 2024, arXiv: arXiv:2411.10170. doi: [10.48550/arXiv.2411.10170](https://doi.org/10.48550/arXiv.2411.10170).*
```bibtex
@misc{spieker2024ArbitrationGraphs,
title={Better Safe Than Sorry: Enhancing Arbitration Graphs for Safe and Robust Autonomous Decision-Making},
author={Piotr Spieker and Nick Le Large and Martin Lauer},
year={2024},
eprint={2411.10170},
eprinttype = {arXiv},
archivePrefix={arXiv},
primaryClass={cs.RO},
doi = {10.48550/arXiv.2411.10170},
url={https://arxiv.org/abs/2411.10170},
}
```
<details>
<summary>Earlier publications</summary>
### Behavior Verification and Fallback Layers
A safety concept that extends Arbitration Graphs with behavior verification and fallback layers in the context of automated driving has been proposed by Piotr Spieker (née Orzechowski) in his PhD thesis.
This served as the basis for the paper with Nick above.
_Piotr F. Orzechowski, “Verhaltensentscheidung für automatisierte Fahrzeuge mittels Arbitrationsgraphen,” phd, Karlsruher Institut für Technologie (KIT), 2023. doi: [10.5445/IR/1000160638](https://doi.org/10.5445/IR/1000160638)._
```bibtex
@thesis{Orzechowski2023Arbitrationsgraphen,
type = {phdthesis},
title = {Verhaltensentscheidung für automatisierte Fahrzeuge mittels Arbitrationsgraphen},
author = {Orzechowski, Piotr Franciszek},
date = {2023},
institution = {Karlsruher Institut für Technologie (KIT)},
doi = {10.5445/IR/1000160638},
langid = {german},
pagetotal = {169},
}
```
### Replacing state machines in AV
Arbitration Graphs replaced state machines in the context of automated driving at the Institute of Measurement and Control Systems (MRT) of the Karlsruhe Institute of Technology (KIT):
_Piotr F. Orzechowski, Christoph Burger, and Martin Lauer, “Decision-Making for Automated Vehicles Using a Hierarchical Behavior-Based Arbitration Scheme,” in Intelligent Vehicles Symposium, Las Vegas, NV, USA: IEEE, Oct. 2020, pp. 767–774. doi: [10.1109/IV47402.2020.9304723](https://doi.org/10.1109/IV47402.2020.9304723)._
```bibtex
@inproceedings{orzechowski2020ArbitrationGraphs,
title = {Decision-Making for Automated Vehicles Using a Hierarchical Behavior-Based Arbitration Scheme},
booktitle = {Intelligent Vehicles Symposium},
author = {Orzechowski, Piotr F. and Burger, Christoph and Lauer, Martin},
date = {2020-10},
pages = {767--774},
publisher = {IEEE},
location = {Las Vegas, NV, USA},
issn = {2642-7214},
doi = {10.1109/IV47402.2020.9304723},
}
```
### Foundation work in Robot Soccer
The foundations for Arbitration Graphs have been proposed in the context of robot soccer:
_Martin Lauer, Roland Hafner, Sascha Lange, and Martin Riedmiller, “Cognitive concepts in autonomous soccer playing robots,” Cognitive Systems Research, vol. 11, no. 3, pp. 287–309, 2010, doi: [10.1016/j.cogsys.2009.12.003](https://doi.org/10.1016/j.cogsys.2009.12.003)._
```bibtex
@article{lauer2010CognitiveConceptsAutonomous,
title = {Cognitive Concepts in Autonomous Soccer Playing Robots},
author = {Lauer, Martin and Hafner, Roland and Lange, Sascha and Riedmiller, Martin},
date = {2010},
journaltitle = {Cognitive Systems Research},
volume = {11},
number = {3},
pages = {287--309},
doi = {10.1016/j.cogsys.2009.12.003},
}
```
</details>
Raw data
{
"_id": null,
"home_page": null,
"name": "arbitration-graphs",
"maintainer": "Piotr Spieker, Nick Le Large",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "robotics, decision-making, behavior generation, hierarchical behavior models",
"author": "Christoph Burger, Piotr Spieker, Nick Le Large",
"author_email": null,
"download_url": null,
"platform": null,
"description": "# Arbitration Graphs\n\n[](https://github.com/KIT-MRT/arbitration_graphs/releases)\n[](./LICENSE)\n[](https://github.com/KIT-MRT/arbitration_graphs/actions/workflows/run-unit-tests.yaml?query=branch%3Amain)\n\n*TL;DR: Replace those rusty state machines with safe and scalable arbitration graphs!*\n\n**Hierarchical behavior models for complex decision-making and behavior generation in robotics!**\n\n- \ud83c\udf31 **Bottom-up** \n Combine simple atomic behavior components to generate complex behaviors.\n- \ud83e\udde9 **Functional decomposition** \n Behavior components address *How to do it?* and *Can we do it?*, while Arbitrators decide *What to do?*\n - \ud83e\udde0 **Meta-framework** \n Integrate diverse methods in one decision-making framework. Why not combine optimization-based planning, probabilistic approaches (POMDPs), and machine learning (RL)? Use any approach where it performs best!\n- \ud83d\udee0\ufe0f **Maintainability** \n Add new behaviors without having to touch existing ones \u2013 did we mention strict modularity and functional decomposition?\n- \ud83d\udee1\ufe0f **Behavior Verification** \n Use tightly integrated verifiers to ensure that only safe and valid behavior commands are executed.\n- \ud83e\ude82 **Graceful Degradation** \n Your behavior is unreliable or unsafe? Arbitrators will gracefully fall back to the next-best option.\n\n\n<details>\n<summary>\ud83d\ude0b Click for more reasons!</summary>\n\n- \ud83d\udcc8 **Scalability** \n Stack behavior components in arbitrators to create hierarchical behavior models.\n- \ud83d\udca1 **Transparency** \n Easily follow and understand the decision-making process, e.g., with our GUI.\n- \ud83d\udce6 **Header-Only** \n Simple integration \u2013 just include this header-only C++17 library!\n- \ud83d\udc0d **Python Bindings** \n For easy prototyping, testing, and integration of machine learning algorithms, all the functionality is available via Python bindings.\n- \ud83d\udcdc **Permissive License** \n Published under MIT license to ensure maximum flexibility for your projects.\n\n</details>\n\n\n<details>\n<summary>\ud83e\udd28 How does it compare to Behavior Trees?</summary>\n\nBehavior Trees (BTs) are great for a variety of applications and thrive within a vibrant community! \nKudos to [Petter \u00d6gren's](https://www.kth.se/profile/petter/) crew, [Michele Colledanchise](https://miccol.github.io/behaviortrees/) and [Davide Faconti](https://github.com/facontidavide) \ud83d\udd96\n\nBut, Arbitration Graphs bring great value, especially for safety critical applications like self-driving cars and mobile robots in general \u2013 by strictly coupling preconditions to behaviors and tightly integrating behavior verification.\nA bit more in detail:\n\n| | Behavior Trees | Arbitration Graphs |\n| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **Interfaces** | Nodes return execution status (*success*, *failure*, or *running*). <br>\u23f5 more flexibility w.r.t. a node's actuator interfaces | Behavior components & arbitrators return commands (e.g., a trajectory). <br>\u23f5 control theory motivated interface ${f(\\boldsymbol{x}) \\to \\boldsymbol{u}}$ <br>\u23f5 command can be verified by each arbitrator |\n| **Preconditions** | Implemented by condition nodes distributed throughout the tree. <br>\u23f5 easy to reuse preconditions for multiple behaviors | Require behavior components to define their own preconditions. <br>\u23f5 tight coupling of preconditions to behaviors <br>\u23f5 robustness and safety less dependent on node arrangement |\n| **Safety** | Each node decides on its success or failure. <br>\u23f5 can lead to safety and reliability issues, if not carefully managed | Integrate safety into the selection mechanism, using node-independent verifiers. <br>\u23f5 reduces the burden on behavior engineers <br>\u23f5 allows an easy integration of unsafe behavior components (ML, probabilistic, \u2026) |\n\n</details>\n\n## At a Glance\n\n**Arbitration Graphs** break down complex decision-making into atomic behavior components and arbitrators.\n\n**Behavior components** compute a command (e.g., a trajectory) based on the current state of the world.\nThey define whether they can be executed in the current state using their invocation condition.\n\n**Arbitrators** select the best option based on a defined decision-making policy.\nOptions can be behavior components or nested arbitrators.\n\n**Verifiers** check whether the command of a behavior component is safe and valid prior to being selected by an arbitrator.\n\n<p align=\"center\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/arbitration_graphs_at_a_glance_dark.svg\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/arbitration_graphs_at_a_glance_light.svg\">\n <img src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/arbitration_graphs_at_a_glance_light.svg\">\n </picture>\n</p>\n\n\n## Demo\n\nWe provide a demo of this library using Pac-Man as an example application. \nThe arbitration graph controls Pac-Man on its journey to collect tasty dots \ud83c\udf6c\n\nRun the demo with:\n\n```bash\ngit clone https://github.com/KIT-MRT/arbitration_graphs.git\ncd arbitration_graphs/demo\ndocker compose up\n```\n\nOpen the GUI with your favorite browser: \n[http://0.0.0.0:8080](http://0.0.0.0:8080)\n\n### Explanation\n\nYou will see the *Pacman Agent* arbitrator selecting between five behavior options (by priority). \nThe *Eat Dots* option is itself an arbitrator with two sub-behaviors (selecting by expected benefit).\n\nIn this scene,\n- the *Chase Ghost* and *Avoid Ghost* behaviors are not applicable (no ghosts in close vicinity) \u2192 grey background,\n- the *Eat Closest Dot* and *Move Randomly* behavior failed verification (our verification showcase) \u2192 red background,\n- thus, the least-prioritized *Stay in Place* behavior is being executed \u2192 green background.\n\n<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/pacman_scenario_cropped.png\" width=\"300\" />\n</p>\n<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/pacman_arbitrator_safe.svg\" width=\"500\" /> \n</p>\n\n## Installation\n\n> **Note:** We are currently working on a new major release of the library which will include some breaking changes.\n> See the corresponding [issue](https://github.com/KIT-MRT/arbitration_graphs/issues/116) and [pull request](https://github.com/KIT-MRT/arbitration_graphs/pull/123) for details and the current status.\n\nThe Python interface to the arbitration graph library is generated using `pybind11` and provides a convenient interface to utilize the full power of the arbitration graph library in Python.\n\n### Via PyPI (Recommended)\n\nEven more good news: The package is available on PyPI, so installing it is as easy as running:\n\n```bash\npip install arbitration-graphs\n```\n\n> **Note:** The package requires Python 3.8 or higher and currently only supports a limited set of platforms.\n> Let us know if you need support for an additional platform and we will see what we can do!\n\n### From Source\n\nYou can also build the package from source.\nHandy for development or if your target platform is currently not supported by the pre-built package.\n\n<details>\n<summary>Prerequisites</summary>\n\nFirst make sure all dependencies are installed:\n- The arbitration graph core library (see [../README.md](../README.md))\n- Python 3.8 or higher\n- [ninja](https://ninja-build.org/)\n\nSee also the [`Dockerfile`](./Dockerfile) for how to install these packages under Debian or Ubuntu.\n</details>\n\n<details>\n<summary>Via pip</summary>\n\n\n```bash\n# From local repository\ngit clone https://github.com/KIT-MRT/arbitration_graphs.git\ncd arbitration_graphs/python_bindings\npip install .\n\n# Or directly from GitHub\npip install git+https://github.com/KIT-MRT/arbitration_graphs.git#subdirectory=python_bindings\n```\n</details>\n\n<details>\n<summary>Via CMake</summary>\n\nClone the repository and build the package using CMake:\n```bash\nmkdir -p arbitration_graphs/python_bindings/build\ncd arbitration_graphs/python_bindings/build\ncmake ..\ncmake --build .\n```\n</details>\n\n## Development\n\n<details>\n<summary>Using Docker image</summary>\n\nClone the repository and run the development image\n\n```bash\ngit clone https://github.com/KIT-MRT/arbitration_graphs.git\ncd arbitration_graphs/python_bindings\ndocker compose build arbitration_graphs_pybind_devel\ndocker compose run --rm arbitration_graphs_pybind_devel\n```\n\nThis mounts the source into the container's `/home/blinky/arbitration_graphs` folder.\nThere, you can edit the source code, compile and run the tests etc.\n\n</details>\n\n\n<details>\n<summary>Running unit tests</summary>\n\nThis package includes unit tests analogous to the C++ tests.\nTo run all tests, use the following command:\n\n```bash\ncd arbitration_graphs/python_bindings/test\npython -m unittest discover\n```\n</details>\n\n## Contributors\n\nThis library and repo has been crafted with \u2764\ufe0f by\n\n**Christoph Burger**\n<span> \n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark-white.svg\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg\">\n <img height=\"16\" class=\"github-logo\" src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg\" alt=\"GitHub Invertocat\"/>\n </picture>\n <a href=\"https://github.com/ChristophBurger89\" aria-label=\"View GitHub profile\">\n ChristophBurger89\n </a>\n \n <img height=\"16\" style=\"height:1em; position: relative; top:.2em\" src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/In-Blue-128@2x.png\" alt=\"LinkedIn logo\"/>\n <a href=\"https://www.linkedin.com/in/christoph-burger\" aria-label=\"View LinkedIn profile\">\n christoph-burger\n </a>\n \n <img height=\"16\" style=\"height:1em; position: relative; top:.2em\" src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/ORCID-iD_icon_vector.svg\" alt=\"ORCID iD\"/>\n <a href=\"https://orcid.org/0009-0002-9147-8749\" aria-label=\"View ORCID record\">\n 0009-0002-9147-8749\n </a>\n</span>\n<br>\n**Nick Le Large**\n<span>\n \n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark-white.svg\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg\">\n <img height=\"16\" class=\"github-logo\" src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg\" alt=\"GitHub Invertocat\"/>\n </picture>\n <a href=\"https://github.com/ll-nick\" aria-label=\"View GitHub profile\">\n ll-nick\n </a>\n \n <img height=\"16\" style=\"height:1em; position: relative; top:.2em\" src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/In-Blue-128@2x.png\" alt=\"LinkedIn logo\"/>\n <a href=\"https://www.linkedin.com/in/nick-le-large\" aria-label=\"View LinkedIn profile\">\n nick-le-large\n </a>\n \n <img height=\"16\" style=\"height:1em; position: relative; top:.2em\" src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/ORCID-iD_icon_vector.svg\" alt=\"ORCID iD\"/>\n <a href=\"https://orcid.org/0009-0006-5191-9043\" aria-label=\"View ORCID record\">\n 0009-0006-5191-9043\n </a>\n</span>\n<br>\n**Piotr Spieker**\n<span>\n \n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark-white.svg\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg\">\n <img height=\"16\" class=\"github-logo\" src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg\" alt=\"GitHub Invertocat\"/>\n </picture>\n <a href=\"https://github.com/orzechow\" aria-label=\"View GitHub profile\">\n orzechow\n </a>\n \n <img height=\"16\" style=\"height:1em; position: relative; top:.2em\" src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/In-Blue-128@2x.png\" alt=\"LinkedIn logo\"/>\n <a href=\"https://www.linkedin.com/in/piotr-spieker\" aria-label=\"View LinkedIn profile\">\n piotr-spieker\n </a>\n \n <img height=\"16\" style=\"height:1em; position: relative; top:.2em\" src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/ORCID-iD_icon_vector.svg\" alt=\"ORCID iD\"/>\n <a href=\"https://orcid.org/0000-0002-0449-3741\" aria-label=\"View ORCID record\">\n 0000-0002-0449-3741\n </a>\n</span>\n\nChristoph and Piotr coded the core in a pair-programming session.\nPiotr also contributed the GUI and GitHub Page.\nNick implemented the awesome PacMan demo and tutorial, with drafting support by Christoph, reviews and finetuning by Piotr.\nThe Python bindings have been contributed by Nick and reviewed by Piotr.\n\nThe repository is maintained by Piotr Spieker \n<span>\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark-white.svg\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg\">\n <img height=\"16\" class=\"github-logo\" src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg\" alt=\"GitHub Invertocat\"/>\n </picture>\n <a href=\"https://github.com/orzechow\" aria-label=\"View GitHub profile\">\n orzechow\n </a>\n</span>\nand\nNick Le Large \n<span>\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark-white.svg\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg\">\n <img height=\"16\" class=\"github-logo\" src=\"https://raw.githubusercontent.com/KIT-MRT/arbitration_graphs/main/docs/assets/img/github-mark.svg\" alt=\"GitHub Invertocat\"/>\n </picture>\n <a href=\"https://github.com/ll-nick\" aria-label=\"View GitHub profile\">\n ll-nick\n </a>\n</span>.\n\n\n## Citation\n\nIf you use arbitration graphs in your research, we would be pleased if you cite our work:\n\n*Piotr Spieker, Nick Le Large, and Martin Lauer, \u201cBetter Safe Than Sorry: Enhancing Arbitration Graphs for Safe and Robust Autonomous Decision-Making,\u201d Nov. 15, 2024, arXiv: arXiv:2411.10170. doi: [10.48550/arXiv.2411.10170](https://doi.org/10.48550/arXiv.2411.10170).*\n\n```bibtex\n@misc{spieker2024ArbitrationGraphs,\n title={Better Safe Than Sorry: Enhancing Arbitration Graphs for Safe and Robust Autonomous Decision-Making}, \n author={Piotr Spieker and Nick Le Large and Martin Lauer},\n year={2024},\n eprint={2411.10170},\n eprinttype = {arXiv},\n archivePrefix={arXiv},\n primaryClass={cs.RO},\n doi = {10.48550/arXiv.2411.10170},\n url={https://arxiv.org/abs/2411.10170}, \n}\n```\n\n\n<details>\n<summary>Earlier publications</summary>\n\n### Behavior Verification and Fallback Layers\nA safety concept that extends Arbitration Graphs with behavior verification and fallback layers in the context of automated driving has been proposed by Piotr Spieker (n\u00e9e Orzechowski) in his PhD thesis.\nThis served as the basis for the paper with Nick above.\n\n_Piotr F. Orzechowski, \u201cVerhaltensentscheidung f\u00fcr automatisierte Fahrzeuge mittels Arbitrationsgraphen,\u201d phd, Karlsruher Institut f\u00fcr Technologie (KIT), 2023. doi: [10.5445/IR/1000160638](https://doi.org/10.5445/IR/1000160638)._\n\n```bibtex\n@thesis{Orzechowski2023Arbitrationsgraphen,\n type = {phdthesis},\n title = {Verhaltensentscheidung f\u00fcr automatisierte Fahrzeuge mittels Arbitrationsgraphen},\n author = {Orzechowski, Piotr Franciszek},\n date = {2023},\n institution = {Karlsruher Institut f\u00fcr Technologie (KIT)},\n doi = {10.5445/IR/1000160638},\n langid = {german},\n pagetotal = {169},\n}\n```\n\n### Replacing state machines in AV\nArbitration Graphs replaced state machines in the context of automated driving at the Institute of Measurement and Control Systems (MRT) of the Karlsruhe Institute of Technology (KIT):\n\n_Piotr F. Orzechowski, Christoph Burger, and Martin Lauer, \u201cDecision-Making for Automated Vehicles Using a Hierarchical Behavior-Based Arbitration Scheme,\u201d in Intelligent Vehicles Symposium, Las Vegas, NV, USA: IEEE, Oct. 2020, pp. 767\u2013774. doi: [10.1109/IV47402.2020.9304723](https://doi.org/10.1109/IV47402.2020.9304723)._\n\n```bibtex\n@inproceedings{orzechowski2020ArbitrationGraphs,\n title = {Decision-Making for Automated Vehicles Using a Hierarchical Behavior-Based Arbitration Scheme},\n booktitle = {Intelligent Vehicles Symposium},\n author = {Orzechowski, Piotr F. and Burger, Christoph and Lauer, Martin},\n date = {2020-10},\n pages = {767--774},\n publisher = {IEEE},\n location = {Las Vegas, NV, USA},\n issn = {2642-7214},\n doi = {10.1109/IV47402.2020.9304723},\n}\n```\n\n### Foundation work in Robot Soccer\nThe foundations for Arbitration Graphs have been proposed in the context of robot soccer:\n\n_Martin Lauer, Roland Hafner, Sascha Lange, and Martin Riedmiller, \u201cCognitive concepts in autonomous soccer playing robots,\u201d Cognitive Systems Research, vol. 11, no. 3, pp. 287\u2013309, 2010, doi: [10.1016/j.cogsys.2009.12.003](https://doi.org/10.1016/j.cogsys.2009.12.003)._\n\n```bibtex\n@article{lauer2010CognitiveConceptsAutonomous,\n title = {Cognitive Concepts in Autonomous Soccer Playing Robots},\n author = {Lauer, Martin and Hafner, Roland and Lange, Sascha and Riedmiller, Martin},\n date = {2010},\n journaltitle = {Cognitive Systems Research},\n volume = {11},\n number = {3},\n pages = {287--309},\n doi = {10.1016/j.cogsys.2009.12.003},\n}\n```\n\n</details>\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Hierarchical behavior models for complex decision-making and behavior generation in robotics",
"version": "0.10.0",
"project_urls": {
"Homepage": "https://kit-mrt.github.io/arbitration_graphs/",
"Issues": "https://github.com/KIT-MRT/arbitration_graphs/issues",
"Repository": "https://github.com/KIT-MRT/arbitration_graphs"
},
"split_keywords": [
"robotics",
" decision-making",
" behavior generation",
" hierarchical behavior models"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "8f971693f0114c6d0165d25e3c7e02f86ad4d84f9277efbf4ed0f11a85a3dc70",
"md5": "fcf8ac9900526b689a8084cff414c9aa",
"sha256": "6b490b38e6066c6372ec2cd243945621a60ac397035b4056c1b34a723a849434"
},
"downloads": -1,
"filename": "arbitration_graphs-0.10.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "fcf8ac9900526b689a8084cff414c9aa",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 528513,
"upload_time": "2025-07-15T13:35:07",
"upload_time_iso_8601": "2025-07-15T13:35:07.182997Z",
"url": "https://files.pythonhosted.org/packages/8f/97/1693f0114c6d0165d25e3c7e02f86ad4d84f9277efbf4ed0f11a85a3dc70/arbitration_graphs-0.10.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7cf2a63efc08a89d1e16c3a10ee945a0b4a6dc7543dc8374961aea5f731658e9",
"md5": "99f5fd9f1bbf23d6adf40ffefb462493",
"sha256": "3c00e1c5c1b1a73dd9f152b09da8f3ed82f3f21907ce088c32deef2d73a3d6cc"
},
"downloads": -1,
"filename": "arbitration_graphs-0.10.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "99f5fd9f1bbf23d6adf40ffefb462493",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 530494,
"upload_time": "2025-07-15T13:35:08",
"upload_time_iso_8601": "2025-07-15T13:35:08.228180Z",
"url": "https://files.pythonhosted.org/packages/7c/f2/a63efc08a89d1e16c3a10ee945a0b4a6dc7543dc8374961aea5f731658e9/arbitration_graphs-0.10.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "bee2b06597b5433a33b7628bdf8b32feb6ab9f7927130729dc9583fed74df180",
"md5": "5a51e28b87366deb687f73b3061fb7c7",
"sha256": "68764bafc37622a877754a58e23a16c974b9b8c009f1a742c5d1c6b8f09db8e2"
},
"downloads": -1,
"filename": "arbitration_graphs-0.10.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "5a51e28b87366deb687f73b3061fb7c7",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 529404,
"upload_time": "2025-07-15T13:35:09",
"upload_time_iso_8601": "2025-07-15T13:35:09.360048Z",
"url": "https://files.pythonhosted.org/packages/be/e2/b06597b5433a33b7628bdf8b32feb6ab9f7927130729dc9583fed74df180/arbitration_graphs-0.10.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ef2b357b83f871fd8aff58904fbd8535c421b976b1fe5ce4e13102c2d4ef5d24",
"md5": "56732825d0e678470c8245b3e40eaf5e",
"sha256": "eed48ada0d0db97b60b52b7abd38f23eabc79cf2bcf7b13e94b2f600e842a5c7"
},
"downloads": -1,
"filename": "arbitration_graphs-0.10.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "56732825d0e678470c8245b3e40eaf5e",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.8",
"size": 529280,
"upload_time": "2025-07-15T13:35:10",
"upload_time_iso_8601": "2025-07-15T13:35:10.271275Z",
"url": "https://files.pythonhosted.org/packages/ef/2b/357b83f871fd8aff58904fbd8535c421b976b1fe5ce4e13102c2d4ef5d24/arbitration_graphs-0.10.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c326e371e16c00adc5b8d213327560bdaa9eb4929ae34b324d34c010a13561a0",
"md5": "09b4102f44276e7d62f69f9cd796ae79",
"sha256": "7a9eab316f745666859be2f6dd11f090582f1fd057efc45ea7729811781743d9"
},
"downloads": -1,
"filename": "arbitration_graphs-0.10.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "09b4102f44276e7d62f69f9cd796ae79",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 528153,
"upload_time": "2025-07-15T13:35:11",
"upload_time_iso_8601": "2025-07-15T13:35:11.307725Z",
"url": "https://files.pythonhosted.org/packages/c3/26/e371e16c00adc5b8d213327560bdaa9eb4929ae34b324d34c010a13561a0/arbitration_graphs-0.10.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ceb44840ded40d4aea9b1a68ae5d789ad55599dbc0528240c1bcdba1ebf77f57",
"md5": "cbe52a0e6179bb3161974e3b984f59ac",
"sha256": "823e65dab84956c719199cb6663c85775d04056d67b587d873c88bdc8a43af28"
},
"downloads": -1,
"filename": "arbitration_graphs-0.10.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "cbe52a0e6179bb3161974e3b984f59ac",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 529019,
"upload_time": "2025-07-15T13:35:12",
"upload_time_iso_8601": "2025-07-15T13:35:12.283893Z",
"url": "https://files.pythonhosted.org/packages/ce/b4/4840ded40d4aea9b1a68ae5d789ad55599dbc0528240c1bcdba1ebf77f57/arbitration_graphs-0.10.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-15 13:35:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "KIT-MRT",
"github_project": "arbitration_graphs",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "arbitration-graphs"
}