pdiffsim

pdiffsim is a simulation framework for studying linguistic diffusion. It is implemented in Python and makes optional use of the graph-tool library.

Features:

  • implemented in Python3
  • can be run either locally with graphical output on the screen, or remotely on a server
  • two modes: spatial arrangement of agents on a 2D grid, or use of a social network (either use a predefined one or create a randomized one)
  • fully customizable through config files
  • optional graphical output with GTK/graph-tool (both onscreen and offscreen)
  • fairly fast even for large networks up to 2000 agents
  • uses R scripts to automatically produce graphs after a simulation run

Requirements:

  • Python3
  • PIL and/or graph-tool (depends itself on GTK for graphical output)
  • Scipy/Numpy
  • R language (for automated graphs)
  • preferrably a UNIX environment with Makefile / Bash
The code is available on GitHub under a MIT-License.

Demos:

This is a demo that shows a simulation run in which an innovation (green) successfully spreads throughout a social network. In this scenario, the innovation is given a variant bias so that it wins out against the conservative variant (red).

Here we use a network of 200 agents and give the agents a discrete production mechanism (binary choice between innovation or old variant). Using a variant bias, we observe a cascade of change.

Here we use a network of 2000 agents and an alternative diffusion mechanism which produces a wave that diminishes in strength as it travels.

Author:

Luzius Thöny, lucius "dot" antonius "ät" gmail "dot" com

Acknowledgment:

This software was written in the course of a research project sponsored by the Swiss National Science Foundation, Grant Nr. 151606.