https://github.com/manik2000/q-voter
Web application built with Python and Dash simulating the q-voter model evolution.
https://github.com/manik2000/q-voter
dash python q-voter
Last synced: about 1 year ago
JSON representation
Web application built with Python and Dash simulating the q-voter model evolution.
- Host: GitHub
- URL: https://github.com/manik2000/q-voter
- Owner: Manik2000
- Created: 2021-10-01T11:15:19.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-08-28T17:56:48.000Z (almost 3 years ago)
- Last Synced: 2025-01-30T04:25:29.385Z (over 1 year ago)
- Topics: dash, python, q-voter
- Language: Python
- Homepage:
- Size: 29.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Q-voter model simulation
A Dash web application with simulation of evolution of Q-voter model with two kinds of agent behaviours:
* with anti-conformity,
* with independence.

## Q-voter model
Q-voter model is a model of binary opinion dynamics (agent opinion is either $+1$ or $-1$). Each agent (a member of some society) can be influenced by their $q$ neighbours. If the neighbours' opinion are consistent, then the agent adopts this opinion. Otherwise, the agents keeps their opinion.
However, some we can introduce some agent behaviours:
* **anti-conformity** — if the neighbours' opinions are consistent, then the agent adopts the opposite opinion with some probabilty $p$,
* **independence** — the agent becomes independent with probability $p$ and flips its opinon with probability $f$.
In this app q-voter model evolution is simulated on a square lattice with periodic boundary conditions. There are different kinds of lattices — see image below.

## Structure
```
├── assets
├── LICENSE
├── README.md
├── .gitignore
├── app.py <- contains Dash app layout and logic
└── scripts/
├── lattice.py <- contains functions for generating initial lattices
└── simulation.py <- contains functions simulating evolution of q-voter models
```
## Web application
You can view the application [here](https://q-voter-simulation.onrender.com/). It is hosted as a web service on [Render](https://render.com/).
## Running application on your own
Please clone the repository, install packages from `requirements.txt` and run `python app.py` in the console.