Hamilton-Jacobi (HJ) reachability analysis based multi-agent reach-avoid game repo.
This repository contains the implementation of the paper "Multi-Agent Reach-Avoid Games: Two Attackers Versus One Defender and Mixed Integer Programming (2023 CDC)". This implementation is based on the OptimizedDP library developed by the MARS lab, Simon Fraser University.
The dynamics of attackers and defenders (including the maximum speed) in different reach-avoid games are in files AttackerDefender1v0.py
, AttackerDefender1v1.py
and AttackerDefender2v1.py
.
We need to calculate several value functions for the further reach-avoid games.
- Run the file
MRAG/hjvalue1v0.py
to obtain the 1 vs. 0 value function1v0AttackDefend.npy
, which is used to generate control inputs of attackers. - Run the file
MRAG/hjvalue1v1.py
to generate the value fucnton1v1AttackDefend_speed15.npy
, which is used to generate control inputs of the defender in the 1 vs. 1 reach-avoid game. - Run the file
MRAG/hjvalue1v1_basement.py
to generate the value fucntion1v1AttackDefend_g30_speed15.npy
for the computation of the 2 vs. 1 value function. - Run the file
MRAG/hjvalue2v1.py
to generate the value function2v1AttackDefend_speed15.npy
, which is used to generate control inputs of the defender. This procedure will take about 1.5 hours and consume around 20 gigabytes of RAM (tested on a 16-thread Intel(R) Core(TM) i9-9900K CPU at 3.60GHz).
So far, all necessarcy value functions are calculated.
Run the file MRAG/plot_figures.py
to obtain the figures of reach-avoid set 2v1_RAS.png
.
- Run the file
MRAG/game2v1.py
to obtain the results of our proposed method. To get the positions of different time instances, change the corresponding setting of the total game duration T:
T = 0.785 # attackers_stop_times = [0.475s (95 A1 is captured), 0.69s (138 A0 by D0)]
-
Run the file
MRAG/game6v2.py
to obtain the results of our proposed method. To get the positions of different time instances, change the corresponding setting of the total game duration T. -
Run the file
MRAG/game6v2_basement.py
to obtain the results of the baseline method. To get the positions of different time instances, change the corresponding setting of the total game duration T.
-
Run the file
MRAG/game8v4.py
to obtain the results of our proposed method. To get the positions of different time instances, change the corresponding setting of the total game duration T. -
Run the file
MRAG/game8v4_basement.py
to obtain the results of the baseline method. To get the positions of different time instances, change the corresponding setting of the total game duration T.