This repository contains the implementation of related article that was written as a part of Crowd behaviour course at the Faculty of Computer and Information Science at the University of Ljubljana.
Each year a lot of terrorist attacks happen all over the world where a lot of people are killed or heavily damaged. With hope to decrease the casualties of such attacks, we present a crowd evacuation simulation that uses fuzzy logic to simulate the movement of people and assailants in different rooms.
First we prepare models for achieving specific goals: obstacle avoidance, path searching and goal seeking. We then integrate these models together by setting a weight for each of the models, which determines how much each of the models affects the object's movement. We test the algorithm by simulating evacuation in different rooms that we prepared in advance. For better understanding of the simulation and creation of different rooms, user interface is implemented.
The article and implementation is based on existing article: Zhou, Min & Dong, Hairong & Wen, Ding & Yao, Xiuming & Sun, Xubin. (2016). Modeling of Crowd Evacuation With Assailants via a Fuzzy Logic Approach. IEEE Transactions on Intelligent Transportation Systems, which can be found here.
The repository contains the following folders:
article
contains the latex files and the article in pdfmaps
contains saved simulation roomspresentation
contains video and ppt presentationresults
contains different simulations' resultssrc
contains the code
Live demo is deployed via GitHub pages and is available here.
To run the visualization locally you just have to clone the repo
clone https://github.com/Blarc/crowd-evacuation.git
and open index.html
in your favourite browser or run it on a local server:
cd crowd-evacuation
# for python3
python -m http.server
For different ways of setting up a local server you can check out link.
Live demo can be seen here.
For creating rooms and running simulations you either have to upload a saved configuration or
create your own. Some saved configurations are saved in folder maps
. If you would like to
create and run your own simulations, you can do so with different mouse modes, that can be
enabled via keyboard:
- D - enables drawing obstacles mode
- P - enables drawing pedestrians mode
- A - enables drawing assailant mode
- I - enables drawing pedestrians with custom goal mode (first click creates pedestrian, second click creates goal)
- E - enables erasing mode
- C - clears all created obstacles, pedestrians and assailants
- Size - change the obstacle's size when drawing
- V - hide / show pedestrian arcs
- K - hide / show assailnt arcs
- SPACE - pause / resume simulation
- U - remove all global and local goals
- R - reset simulation (clears and resets the simulation, if preloaded configuration exists)
- Width / Height - changes the size of the room
- S - download current configuration of the simulation (created obstacles, pedestrians and assailants)
- Choose file - upload saved simulation configuration
- Run simulations - automatically resets simulation when there is no pedestrians left in the room and saves statistics each second
- T - download simulation statistics
External libraries have been used for the visualization: