|
| 1 | +# Example Benchmark |
| 2 | + |
| 3 | +Repository showing how to use BARK for research, e.g., conducting reproducible experiments. The core of this example repository is to run a benchmark of a single agent Monte Carlo Tree Search and compare it with MCTS variants, that incorporate penalties for violating traffic rules to their reward function. The study focuses on merging -- an arbitrary number of scenarios can be generated, where the initial positions and velocities of the vehicles are sampled randomly from a normal distribution. |
| 4 | + |
| 5 | +## Getting started: |
| 6 | +If you are not familar with BARK yet, check out our BARK paper [paper](https://arxiv.org/abs/2003.02604) and the code documentation [documentation](https://bark-simulator.readthedocs.io/en/latest/). |
| 7 | +This repository uses a virtual environment just as BARK does (install via `bash tools/python/setup_venv.sh` and then source it via `source tools/python/into_venv.sh`) |
| 8 | + |
| 9 | +## What is in there: |
| 10 | +There are three targets ready for execution |
| 11 | +* `merging_test_random`: runs N scenarios and sample the initial states randomly |
| 12 | +* `merging_test_specific`: runs a specific scenario (you can tune them) |
| 13 | +* `run_benchmark`: runs a full benchmark |
| 14 | +* `scenario_tuning`: runs a lightweight benchmark with visualization to find suitable scenario generation parameters |
| 15 | + |
| 16 | +## Benchmark |
| 17 | +First, execute `bazel run //src/run:run_benchmark`. The results of the benchmark will be saved at |
| 18 | +`example_benchmark/bazel-bin/src/run/run_benchmark.runfiles/example_benchmark`. Copy the file to `results/benchmark`. The result file consists of a pandas dataframe, that represents the outcome of each benchmark simulation run. To visualize that, we have prepared an ipython notebook. You can start the notebook server via `bazel run //src/create_figures:run_notebooks` and then select the `plot_benchmark_results` notebook. The code will generate the following figure: |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +### Changing Parameters: |
| 23 | +Parametrization in BARK is done via the `ParameterServer`, which reads json-files. You can tweak the existing ones: |
| 24 | +* for the viewer in `viewer_config/params/` |
| 25 | +* for the behavior models in `mcts_config/params/` |
| 26 | + |
| 27 | +Of course, those json-files are quite nested, so we provide scripts to generate them with default values. |
| 28 | +* for the viewer: `src/viewer_config/viewer_config_test.py` |
| 29 | +* for the behavior models: `src/mcts_config/mcts_config_test.py` |
| 30 | +The concept for creating parameter files can be transferred to any other object. |
| 31 | + |
| 32 | +### Evaluators: |
| 33 | +Evaluators can be used as a metric to analyze the benchmark, but also as a termination criterion for a simulation run. You can choose from any Evaluator in https://github.com/bark-simulator/bark/tree/master/bark/world/evaluation. Using EvaluatorLTL for example allows you to use a wide range of traffic rules. |
| 34 | + |
| 35 | +### Scenarios: |
| 36 | +The scenarios are generated based on the config files in `src/database/scenario_sets`. |
| 37 | + |
| 38 | +## Dependency Management using Bazel |
| 39 | +As you can see in the [bark-simulator Github Group](https://github.com/bark-simulator/), the BARK ecosystem is split over multiple Github repositories. One reason for this was to keep the core functionalities light-weight and reasonably fast to build. Specifically, a lot of planning modules are placed in seperate repositories. Using Bazel as our build environment enables the reproducibility of our experiments, as dependency versions of the repositories can be tracked easily. |
| 40 | + |
| 41 | +For example, have a look to `tools/deps.bzl`, where the specific dependencies and either their commit hashs or a specific branch can be selected. In order to try two different versions of your planner (located in another repo), you do not build or install them manually, you just need to change the commit hash. |
| 42 | + |
| 43 | +## Cite us |
| 44 | + |
| 45 | +This repository contains work from multiple publications: |
| 46 | +* Traffic Rules as Evaluators: [Formalizing Traffic Rules for Machine Interpretability](https://arxiv.org/abs/2007.00330) |
| 47 | +* MCTS with Traffic Rules: [Modeling and Testing Multi-Agent Traffic Rules within Interactive Behavior Planning](https://arxiv.org/abs/2009.14186) |
| 48 | + |
| 49 | +If you use them, please cite them. |
| 50 | + |
| 51 | +For everything else, please cite us using the following [paper](https://arxiv.org/abs/2003.02604): |
| 52 | + |
| 53 | +``` |
| 54 | +@inproceedings{Bernhard2020, |
| 55 | + title = {BARK: Open Behavior Benchmarking in Multi-Agent Environments}, |
| 56 | + author = {Bernhard, Julian and Esterle, Klemens and Hart, Patrick and Kessler, Tobias}, |
| 57 | + booktitle = {2020 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)}, |
| 58 | + url = {https://arxiv.org/pdf/2003.02604.pdf}, |
| 59 | + year = {2020} |
| 60 | +} |
| 61 | +``` |
0 commit comments