Code Monkey home page Code Monkey logo

Crowd Dynamics

Crowd dynamics is a simulation environment written in Python package for simulation movement of crowds. The project was created in summer 2016 for Systems Analysis Laboratory at Aalto University in Finland. The documentation has more detail about the project.

Installation

Crowd dynamics is tested on Ubuntu 16.04 using Python 3.6. First, install the Conda package manager. Miniconda distribution is the easiest to install. Then, clone the crowddynamics repository.

git clone https://github.com/jaantollander/crowddynamics.git

Inside the crowddynamics directory, install the Conda environment, activate it, and install crowddynamics as an editable.

conda env create -f environment.yml
conda activate crowd36
pip install --editable .

Graphical User Interface

We can use a graphical user interface (GUI) for visualizing the crowd simulations and display data interactively, which can be very useful for designing new simulations and debugging. We have implemented the GUI for crowddynamics using Qt via pyqt and pyqtgraph. It is maintained separately from the crowddynamics repository due to its dependencies on Qt.

We start by cloning the repository.

git clone https://github.com/jaantollander/crowddynamics-qtgui.git

Inside crowddynamics-qtgui directory, install the requirements and install crowddynamics-qtgui as editable. We must install pyqt version 4 using Conda from the conda-force channel for it to work correctly. Be sure that you activate the environment where you installed crowddynamics.

conda activate crowd36
conda install pyqt=4 -c conda-forge
pip install -r requirements.txt
pip install --editable .

Usage

Inside the crowddynamics/examples directory, we can find example simulations.

from crowddynamics.examples.simulations import Hallway
from crowddynamics.simulation.agents import Circular
from crowddynamics.logging import setup_logging

if __name__ == '__main__':
    setup_logging()
    iterations = 1000
    simulation = Hallway(agent_type=Circular)
    for i in range(iterations):
        simulation.update()

Tests

Tests are implemented using Pytest and Hypothesis.

Install test dependencies.

pip install -r requirements-tests.txt

In the project's root directory, run pystest test suite.

pytest

Documentation

Documentation is created using Sphinx.

Install documentation dependencies

pip install -r requirement-docs.txt

In docs directory.

make html

Versioning

Versioneer is used for versioning.

Crowd Dynamics's Projects

crowddynamics icon crowddynamics

Continuous-time multi-agent crowd simulation engine implemented in Python using Numba and Numpy for performance.

multiobj-guided-evac icon multiobj-guided-evac

The minimum time evacuation of a crowd using rescue guides: a scenario-based approach (article code)

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.