This project generates a multi-agent-based simulation of a 2-D emergency evacuation scenario with three objectives:
- All agents must be lead away from a danger zone, denoted by the half-plane
for some positive scalars
- All agents must be lead to a safety zone, denoted by the half plane
for some positive scalar
- All agents must remain in close proximity during evacuation (rendezvous).
- Leader (L): The goal of L agents is to guide all agents to the safety zone
$x \geq e$ . The objective function of L agents is given by
where
- Helper (H): The goal of H agents is to lead all agents away from the danger zone. By default, they are the agents located closest to the danger zone at the start of the simulation. The objective function of H agents is given by
where
- Follower (F): The goal of F agents is to remain close to their original locations
$(x_0,y_0)$ at the start of the simulation, modeling the tendency to remain in place during real-world emergency evacuations. The objective function of F agents is given by
where
Let
where
During the simulation, each agent can communicate with all agents initialized within a radius
To run the simulation using command line, navigate to the project folder and type:
python main.py <args>
-
--num_agents: Total number of agents, including L, H and F types (type:int, default:100) -
--num_helpers: Total number of H agents (type:int, default:10) -
--num_leaders: Total number of L agents (type:int, default:10) -
--helper_weight: Weight$w_H$ of H agent objective function (type:float, default:20) -
--leader_weight: Weight$w_L$ of L agent objective function (type:float, default:40) -
--follower_weight: Weight$w_F$ of F agent objective function (type:float, default:1) -
--exit_line: Parameter "e" in the safety zone half-plane$x \geq e$ (type:float, default:0.8) -
--danger_angle: Parameter "a" in the danger zone half-plane$y \geq -ax + b$ (type:float, default:0.5) -
--danger_offset: Parameter "b" in the danger zone half-plane$y \geq -ax + b$ (type:float, default:0.9) -
--velocity: Agent velocity (type:float, default:0.1) -
--rendezvous_weight: Weight$\alpha$ of the rendezvous penalty (type:float, default:0.1) -
--num_frames: Number of frames for output video (type:int, default:100) -
--time: Total time of the simulation in artificial time units, i.e., not corresponding to actual run time (type:float, default:500)
Output files follow the convention below:
filename = c_<velocity>_a_<rendezvous_weight>_helpers_<num_helpers>_leaders_<num_leaders>_total_<num_agents>
foldername = wl_<leader_weight>_wh_<helper_weight>_wf_<follower_weight>_exit_<exit_line>_angle_<danger_angle>_offset_<danger_offset>
- A video of the simulation (<filename>.mp4), stored in ./videos/foldername/
- A snapshot of the intialization state, depicting initial positions and the communication graph topology (<filename>_init.png), stored in ./plots/foldername/
- Coordinates of all agents on the 2-D plane throughout the simulation (<filename>_X.npy, <filename>_Y.npy), stored in ./positions/foldername/