Skip to content

lobo/ss-tp6

Repository files navigation

...

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.

Releases

No releases published

Packages

No packages published

Languages