In this repo, we provide the environments including:
Maze Environment 👇 | Box Environment 👇 |
---|---|
and the algorithms that we compare with
- Our Graph Transformer Planner
- Conflict-Based Search Planner
- Enhanced Conflict-Based Search Planner
- Optimal Reciprocal Collision Avoidance Planner
To install, run the following:
conda create -n venv_MASearch python=3.8
conda install numpy
# conda install pyg -c pyg -c conda-forge # install torch geometric
conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=11.3 -c pytorch
conda install pyg -c pyg # install torch geometric 2.0.4
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.12.0+cu113.html
pip install seaborn
pip install wandb
pip install shapely
pip install torchsummary
pip install easydict
We provide an example to plan on Maze and Box with the CBS planner in the tutorial notebook. Using other planners can be easily done by replacing the CBSPlanner
to other planners' classes.
To generate dataset:
python datasetgenerator/DatasetGenMultiAgent.py --env_name BoxEnv \
--min_max_num_agents 1 5
python datasetgenerator/DatasetGenMultiAgent.py --env_name MazeEnv \
--min_max_num_agents 10 20
To split the dataset after generating it from expert solution:
python datasetgenerator/DatasetGenMultiAgent.py --env_name BoxEnv --split_dataset True\
--min_max_num_agents 1 5
python datasetgenerator/DatasetGenMultiAgent.py --env_name MazeEnv --split_dataset True\
--min_max_num_agents 10 20
To post-process dataset:
python dataloader/BatchDataloader.py --env_name BoxEnv --min_max_num_agents 1 5
python dataloader/BatchDataloader.py --env_name MazeEnv --min_max_num_agents 10 20
To post-process dataset (re_preprocess):
python dataloader/BatchDataloader.py --env_name BoxEnv --min_max_num_agents 1 5 --mode train --re_preprocess
python dataloader/BatchDataloader.py --env_name MazeEnv --min_max_num_agents 10 20 --mode train --re_preprocess
To run the experiment in framework (MultiAgentSearch):
Train from scratch on BoxEnv
python main.py --env_name BoxEnv --mode train
Train from scratch on MazeEnv
python main.py --env_name MazeEnv --mode train
Train by continuing learning
python main.py --env_name MazeEnv --mode train --con_train True --log_time 1654091511
python main.py --env_name BoxEnv --mode test --log_time 1654091511
python main.py --env_name MazeEnv --mode test --log_time 1658153431