Code Monkey home page Code Monkey logo

ss-tp6's Introduction

...

Simulation N° 6: Crowd Simulation

Build

To build the project, it is necessary to have Maven +3.5.0, and Java SE 8 Release installed. Then, run:

$ mvn clean package

This will generate a *.jar in the target folder. If you find any issues with the building, remove the *.jar files from the Maven local repository with:

$ rm -fr ~/.m2/repository/ar/edu/itba/ss/*

Or do it manually, if you prefer.

Execute

In the root folder (after build):

$ java -jar target/tp6-1.0-SNAPSHOT-jar-with-dependencies.jar <simulate | animate | flow>

Or better, run the precompiled *.jar in the root (we made it for you):

$ java -jar crowd-simulator.jar <simulate | animate | flow>

Each mode does:

  • simulate: runs the simulation and outputs the *.static, *.state and *.drain files.
  • animate: builds the animation file for Ovito (*.xyz extension).
  • flow: takes the *.drain file and generate a *.flow file, with a temporal serie of the windowed-flow.

Configuration

Receives a JSON file with the following format:

{
    "output"            : "res/data/output",
    "delta"             : "0.0001",
    "time"              : "10.0",
    "fps"               : "50",
    "playbackSpeed"     : "1.0",
    "samplesPerSecond"  : "200",

    "integrator"        : "BeemanIntegrator",
    "reportEnergy"      : "false",
    "reportTime"        : "true",
    "radius"            : ["0.25", "0.29"],
    "mass"              : "80.0",

    "elasticNormal"     : "1.2E+5",
    "elasticTangent"    : "2.4E+5",
    "viscousDamping"    : "6196.773354",
    "siloDamping"       : "6196.773354",

    "a"                 : "2000.0",
    "b"                 : "0.08",
    "tau"               : "0.5",
    "desiredSpeed"      : "5.0",
    "breakRange"        : "2.5",
    "target"            : ["10.0", "0.0"],
    "targetWidth"       : "0.42",

    "generator"         : "73604268647601935",
    "n"                 : "20",
    "height"            : "20.0",
    "width"             : "20.0",
    "drain"             : "1.2",

    "window"            : "5.0",
    "flowRate"          : "0.01"
}

Output Files Format

Static Properties (*.static)

Contains the intrinsic properties of each particle. This properties are static, i.e., they are constant throughout the simulation.

<radius> <mass>
...

Simulation Result (*.state)

The complete state of the simulation. Includes the position and the velocity vector of each particle:

<x> <y> <vx> <vy>
...

Pressure Evolution (*.pressure)

The pressure of the particles (i.e., the magnitude of the collisions and the social forces over normal direction, divided by the perimeter of the body). This has the same time-step like the simulation file:

<pressure>
...

Flow Rate File (*.drain)

This file contains the complete drain (i.e., the ID of a particle drained at a certain time).

<t> <id>
...

Windowed Flow Rate File (*.flow)

This is the slided-windowed flow per unit of temporal step. The units are in [particles/second].

<t> <flow>
...

Animation File (*.xyz)

This file can be used in Ovito to render the simulation:

<N>
<t0>
<x> <y> <radius> <speed> <pressure>
...

Videos

Developers

This project has been built, designed and maintained by the following authors:

Bibliography

"Simulating Dynamical Features of Escape Panic". Dirk Helbing, Illés Farkas and Tamás Vicsek. Nature, Vol. 407. 28th September, 2000. Macmillan Magazine.

ss-tp6's People

Contributors

agustin-golmar avatar lobo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

tubbz-alt

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.