https://github.com/manik2000/drinker-fate-analysis
Dash application with modelling the chances of safe-home return of a heavy drinker.
https://github.com/manik2000/drinker-fate-analysis
dash python stochastic-processes
Last synced: 11 months ago
JSON representation
Dash application with modelling the chances of safe-home return of a heavy drinker.
- Host: GitHub
- URL: https://github.com/manik2000/drinker-fate-analysis
- Owner: Manik2000
- License: mit
- Created: 2021-10-31T12:47:07.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-14T21:51:08.000Z (over 2 years ago)
- Last Synced: 2025-03-25T03:36:40.932Z (about 1 year ago)
- Topics: dash, python, stochastic-processes
- Language: Python
- Homepage:
- Size: 8.46 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Drinker fate analysis
Dash application with modelling the chances of safe-home return of a heavy drinker.

The motion of the drinker is modelled as a 2D Brownian motion $\mathbf{B}_t$ with drift $\mathbf{v}$, so:
$$
\left(x_t, y_t\right) = \left(\mathbf{B}^{(1)}_t + \mathbf{v}^{(1)}, \mathbf{B}^{(2)}_t + \mathbf{v}^{(2)}\right).
$$
Cars appear at random, according to mixed Poisson process jump times (distribution used for modelling is simply uniform distribution). Cars move with constant speed.
---
## Files description
* `analysis.ipynb` contains conclusions from many simulations perfomed for different sets of parameters.
* `app.py` implements Dash application in which user can run the simluations for chosen parameters and check the fate of the drinker with their own eyes thanks to animation.
* `scripts/animation.py` contains a function creating Plotly animation.
* `scripts/utils.py` contains classes `Car` and `Drinker` and mixed Poisson generating functions.
* `scripts/simulation.py` contains function that returns the trajectories of a drinker and cars for chosen simulation parameters.
---
## Running the app
If you want to run the Dash application, please install packages listed in `requirements.txt` and run command
```shell
python app.py
```