/q-voter

Web application built with Python and Dash simulating the q-voter model evolution.

Primary LanguagePython

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.

obraz

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. It is hosted as a web service on Render.

Running application on your own

Please clone the repository, install packages from requirements.txt and run python app.py in the console.