kbarszczak / Crowd_pressure

The project is a simulation of a crowd passing the narrow way based on the Social Force Model.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

banner

This project is the simulation of a crowd passing the narrow way. The implementation is based on Social Force Model presented in 1998. The model is modified by implementing heuristics that modify the behavior of each agent. The following screenshots present the application layout.

The configuration window:

window_configuration

The simulation window:

window_simulation

Motivation

This project is made to test crowd behavior in stressful situations such as evacuations, fires, or floods.

Build Status

The application is almost completely finished. There are written tests for each math function and the whole system is well-tested so there is a low probability that any bugs still exist. The only thing that may be improved/implemented is:

  • the application visualizer class which may change the agent color accordingly to the pressure put on one (it is marked by the proper todo in the code)

Tech/Framework used

This project uses:

  • Java 17
  • JavaFX 19.0.2.1
  • JUnit 5.9.2

The implemented model is based on the following articles:

Screenshots

The simulation work is shown below screenshots

1st situation:

sim_1_1

sim_1_4

2nd situation:

sim_2_1

sim_2_3

Features

The application architecture was designed to be as flexible as possible. Its design allows the user to turn off and on the heuristics and to change the calculation engine during the work. Possible calculation engines are SingleThread and MultiThreadPoolBased. Moreover, the design allows to implementation of other custom heuristics or calculation engines without modifying the application core. To sum up, the key features of this project are:

  • the ease of modifying the heuristics and calculation engine during the work
  • the ease of adding/modifying new heuristics or calculation engines
  • the physical model may also be easily changed
  • the application map and agents placement may be changed by implementing the proper initializer interfaces

All of that is to achived by the design presented on the below simplified UML diagram:

desing_uml

Installation

To install the application please follow the below steps:

  1. Clone the repository
mkdir crowd-pressure
cd crowd-pressure
git clone https://github.com/kbarszczak/Crowd_pressure .
  1. Install all dependencies
cd Crowd_pressure
mvn clean install
  1. Run the jar file
java -jar target/CrowdPressureSimulation.jar

Since now the application should launch and the configuration window should be displayed.

How to Use?

Before the installation, one may implement custom initializers for both the map and the agents to run the simulation in the tested environment. If you are not interested in implementing custom initializes you may use those already implemented. Once the application is launched set up the following:

  • the agent count (this is the number of all the agents present in the simulation)
  • scale coefficient (this is the coefficient applied to the physical calculation. The bigger the number the more the physical impact is)
  • destination radius (this is the radius of the circle that the agents are trying to reach)
  • delay in ms (since the simulation world is discrete the ticking time has to be specified. The lower the number the more precise the simulation is)
  • computation engine (it specifies whether the simulation runs on the single-thread or multi-thread engine)
  • map (this changes the simulation environment)

After the setup process, run the simulation by pushing the start button.

Contribute

  • clone the repository
  • either make the changes or implement todos
  • create the pull request with a detailed description of your changes

About

The project is a simulation of a crowd passing the narrow way based on the Social Force Model.

License:MIT License


Languages

Language:Java 99.4%Language:CSS 0.6%