This repository implements two solvers, Conflict-Based Search (CBS) and Prioritized Planning (PP). The PP solver can be trained using a differentiable framework to adjust edge costs. It also provides scripts for running experiments over various environment configurations and for visualizing the results.
- Python 3.12
- See
requirements.txtfor additional package dependencies (e.g.,numpy,pandas,matplotlib, etc.)
Create and Activate a Conda Environment:
conda create --name flatland-blackbox python=3.12
conda activate flatland-blackboxInstall Requirements
pip install -r requirements.txtTo check that the instalation went smoothly run all tests with:
python -m pytestThe main entry point for running experiments, training, or a single solve is main.py. It accepts various command-line arguments to select the mode and configure parameters. For detailed usage information, run:
python main.py --helpRunning from the Command Line
To run a set of experiments across multiple instances, according to parameters set in run_configs.json:
python main.py --mode experimentsOr to run training on a single configuration:
python main.py --mode train --seed 42 --num_agents 4 --width 30 --height 30 --iters 300 --lr 0.01 --lam 3.0Or simply run a solver (pp or cbs) on a specific instance:
python main.py --mode solve --solver pp --seed 42 --num_agents 4 --width 30 --height 30When a single instance is run, the resulting paths can be vizualized under /outputs, under a the respective folder with the name of the solver used: /pp, /cbs and /trained.
After running experiments, the details of each run along with the aggregated results can be found inside /outputs/experiment_results.csv and /outputs/aggregated_results.csv respectively.
To reproduce the results captured in the outputs/*.csv files, run:
python main.py --mode experimentsWith the given run_configs.json file.