GithubHelp home page GithubHelp logo

abm-orchestra's Introduction

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

abm-orchestra's People

Contributors

alexanderuitendaal avatar eelinee avatar maartenboth avatar marcusvb avatar miloucarmen avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.