Git Product home page Git Product logo

group-social-force's Introduction

Multi-Agent Simulation of Collective Behavior

Group Social Force is implemented with Interactive Opinion Dynamics. This model is an extension of the social force model introduced by Helbing and Molnár (1995) and Helbing, Farkas, and Vicsek (2000). The fundamental idea is demonstrated as below in a feedback style. The model aims at investigating protypes of pedestrian behavior in a general sense. The current version of model especially contributes to simulating the crowd behavior in evacuation scenarios.

In the repository there are several small examples to test protypes of the model. The examples were intially written in Python 2.7, and you need to slightly modify the code if you want to run it in python3. Pygame and Numpy are required to run the code. How-To: python simulator_XXX.py

The latest version of code is in 2Path
Comment and suggestion are appreciated! You can also check the video file pre-evac2.swf to browse the simulation result in the latest version.
https://github.com/godisreal/group-social-force/blob/master/pre-evac2.swf

Thank Shen Shen for his original work on Social Force Model. This repo was initially built up based on Shen Shen's code.
https://github.com/dslwz2008/SocialForceModel

Pull requests welcome!

Current Version:

Walls are abstracted in type of lines and specified in Wall_Data2018.csv

<Start X, Start Y>: Start Point <End X, End Y>: End Point

Agents are specified in the Agent_Data2018.csv

<InitalX, InitialY>: Initial Positions
<DestX, DestY>: Destination Positions
acclTime: Relaxation Time in Social Force Model
tpre: The TPRE Time in the Pre-Evacuation Stage

In advance mode I start to use obstData2018.csv and Door_Data2018.csv, where the walls and doors are considered as rectangular areas.
Several things to do to improve existing work!
Maybe I should write a brief manual in the future. Commets are much appreciated!

group-social-force's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

group-social-force's Issues

pedestrian_0817 missing

Hello,
The class pedestrian_0817 as well as particle_Regroup and math_func are missing in your repository. They are needed by all the simulators.

Can you add them please ?

Interaction of Multi-Agents

How agents interact with each other is an interesting topic to study. An important issue is whether individual opinions will converge to a common state. In other words, how crowd opinion emerge from individual opinions is a complex process, and the crowd opinion represents the convergent pattern.

If anyone has good comments or suggestions on this issue, pleare feel free to leave a message or contact me. Your comments will be appreciated.

Speed Up the Program

Shall I use Cython to speed up the program?
In current test there are only 8 agents and if there are more, the computation slows down.
The computation complexity increases with the number of agents (in form of N^2).
There are some python program that writes agent model in C/C++. Currently I do not want to rewrite the model in C/C++, but maybe Cython is an alternative way to speed up the program.
I haven't used Cython before. Any suggestions?

About Wall Interaction

A problem in current simulation is that an agent may go through the wall if he walk towards the wall too fast. In other words, if an agent's moving speed is sufficiently large, the wall repulsion cannot stop him effectively before he touches the wall physically. Thus, he might go through the wall, and this scenario is obviously unrealistic.
From the perspective of pedestrian modeling, it implies that the wall repulsion defined in the traditional social force model does not work out for this scenario.
Any comments are appreciated.

Social Force and Newton Third Laws

The social force does not agree with Newton 3rd Law in its mathematical expression. However, the model is widely applied in pedestrian motion. Pedestrian motion definitely is within Newton Laws. So any comments or insight about this issue? @chraibi

I suppose the model is consistent with Newton 1st and 2nd Laws. However, the social force does not agree with Newton 3rd Law (actio=reactio). That seems a serious problem. Someone said the particle does not need to follow Newton Laws. However, pedestrian are low speed object in the macroscopic world, and if social force model is used for pedestrian motion, it should be consistent with Newton Laws.

Does not work in Python 3.7.3 with Pygame 1.9.5

After fixing some nasty errors related to mixed spaces and tabs, I run

python 3Particles/simulator_WP0817_3Particles.py

and see an empty windows
Screenshot 2019-04-04 at 20 35 40

After clicking on the red x (close the window) a new window pops up

Screenshot 2019-04-04 at 20 35 53

Closing this one closes also the other one, and that's it.

Am I supposed to see some circles moving around or not? 🤔

About Data Input File

What is the proper data input file? This program uses .csv (Comma-Separated Values), and some others use .xml or json. Any suggestions?
I choose .csv because it is easy to edit .csv in Excel or other similar softwares. This is useful to input various data of pedestrain agents, especially when the number of agents is large.
For building geometry data such as walls and doors, I think .xml or .csv are both good.
Suggestion and comment are much welcome.

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.