Skip to content

This repository contains the code used to model crowdflow simulation in Het Concertgebouw

Notifications You must be signed in to change notification settings

marcusvb/abm-orchestra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Het Concertgebouw, an Agent Based Model Implementation

Background

This repository contains the code used to model crowdflow simulation in Het Concertgebouw. The model is used to test whether changing the entrance to the north side will help with spreading crowd flow more evenly over the building. A statistical test concludes that the new entrance does help reducing crowd density.

You can find analysis of this in our report.

Code overview

Firstly, this repository started as a fork of @mblasiak @potrkedra and @Piturzasty CrowdMovmentSimulation repository. A huge thanks to them as a large part of our code runs using their functions (mainly the OpenGL drawing, GradientMap generation, and part of the AgentManager code).

We have however pivoted the function of the original model (evacuation) to work for crowdflow simulations in a building.

src/ structure:

  1. Simplest way of running the model: gradient_main.py This is the main class which is used to start the simulations. You can run it without modifying the MapConf (parameters for the simulation) by running it with the default values. To do so uncomment the most lower line in the class: G = GradientMain(None).run(). This initialises a GradientMain (full simulation) with default parameters. You can this also import the GradientMain file in order to run the simulation in parallel or with other parameters, for Sensitivity Analysis for instance (see below).

  2. SIM_compare_entrances.py this file modifies the ConfigMap in order to start the simulations as we have run them for our report. It then uses multiprocessing to run multiple instances of our model using the max CPU's available. After these simulations have finished it continues to do the exact same as before however this time the simulation is run with a different entrance. This simulations can be terminated with the density data being written to the src/Logs folder.

  3. SIM_sensitivity_analysis.py this file modifies the ConfigMap in order to start the simulations as we have run them for our report. In this case multiple instances of the simulation are started with different parameters, first using Sensitivity Analysis OFAT (one factor at a time), with the data also being written to the src/Logs folder Afterwards, multiple Global SA instances are started of the model, where the output is also written to src/Logs.

⚠️ ConfigMap passing works only on Linux/MacOS systems

  1. analyse_compare_entrances.py file which performs analysis of the SIM_compare_entrances.py data. A boxplot is generated of the data in src/plots. It also outputs the t-test values to report on statistical difference between the South vs North entrance of the simulations.

  2. analyses_OFAT.py file which performs analysis on the SIM_sensitivity_analysis.py data, only OFAT.

  3. analyse_GlobalSA.py file which performs analysis on the SIM_sensitivity_analysis.py data, but this time Global SA.

  4. generate_direction_maps.py is used to create the direction maps for Het Concertgebouw. This final maps both direction and gradient can be found in src\FINAL_MAPS.

The model

The model's agents are all instances of AgentGradient. This is heavily modified of the original repository. The AgentGradient class contains all the logic of the agents when they are in the environment. The probabilities and distributions are given via the AgentManager class. The Dijkstra Step (weighted Dijkstra) part of the agent movement, which could use the most optmisation is located in src/mode/graph. The constant translation from lists to networkx graphs is what makes the computational complexity of the model very high.

Visualizations

You can find three videos on Youtube of the model. These videos were achieved by setting RECORD_VIS = True and VISUALIZE = True in MapConfs, which dumps the OpenGL buffers to .pngs in the src/images folder. Here we show with the correct parameters the model running as it should. We also show how two other validation attempts failed

About

This repository contains the code used to model crowdflow simulation in Het Concertgebouw

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages