Skip to content

AnthonyW2/rust_pedestrian_simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Micro-scale Pedestrian Simulator

Written in Rust, using Raylib to display the simulation.

Background

This is a very basic simulation I made in about a week for a university unit.
Being my first large Rust project and my first time using Raylib, the code is a bit messy.

Explanation

The goal of this simulation is to reasonably accurately simulate pedestrains walking in two directions through a constricted space.
The simulation was calibrated using data collected in a specific location (with a 25 metre walkway, 6 metres wide), so it probably doesn't represent any other situation well.
The simulation is stochastic - pedestrians are created in random positions with random targets, and random noise is added to their movement.

The specific reason why the simulation was made was to test the impacts of different pedestrian "etiquettes" - in this case, how average travel time differs when everyone stays left or when everyone walks randomly.

The simulation would work very well with concurrency, but I didn't have time to play around with that, so it's currently single-threaded.

Examples

There are 4 environments & simulations included that are based on the location where data was collected - these work the best.
There are also 3 demonstration simulations: a basic debugging environment; a diagonal pathway; and a crossroads. This simulation was not built with crossroads in mind, so there are problems with the last one, but it does work.

Calibration simulation:

image of calibration simulation

Diagonal path:

image of diagonal path simulation

Crossroads (experimental):

image of crossroads simulation

About

A basic micro-scale pedestrian simulator written in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages