This repository contains an implementation of the algorithms and simulations described in
P.Hastedt and H. Werner, "Nonlinear Distributed Model Predictive Flocking with Obstacle Avoidance"
presented at IFAC World Congress, 2023.
It may be used to recreate and validate the simulation results and figures from the paper. To do so, run either of the two scripts simulation.m
and evaluation.m
.
Running the simulations can take up to 1 hour depending on the computer hardware.
For the simulations, an open source MAS library which can be found on GitHub is utilized.
At the top of simulation.m
, the algorithms, scenarios, and configuration files to be simulated can be selected by changing the algorithmIndex
, configIndex
, and scenarioIndex
variables. The simulation results will be saved in the simulation/out
directory and can then be used for evaluation.
At the top of evaluation.m
, the results of the paper can be reproduced by setting the evaluationIndex
. To evaluate additional data generated by the simulation, copy the .mat
files from the simulation/out
directory to the evaluation/data
directory and add the name of the data file to the simData
array at the top of evaluation.m
. Data can then be added to the evaluation scenarios by adding the data index to the dataSelection
array in the Comparison/Evaluation
section of the evaluation.m
script.
When downloading the code from Zenodo, the MAS-simulation submodule directory simulation/MAS-simulation
will be empty. This can be resolved by either directly downloading the code for the paper from GitHub or by downloading the source code of the MAS library to the corresponding directory.
The code in this repository was tested in the following environment:
- Windows 10 Version 21H2
- Matlab 2021a