Skip to main content

An ungodly mixture of lattice models

Project description

Simple rules

Ultimate Lattice Model Monster Mashup

This app started off as an attempt to visualise different lattice models, and to see what happens when you mix a bunch of them together. It is currently very visually-oriented, though I intend to add some analytics later.

Getting started

It is built using Python 3 and Qt5, so you will need both of those. If you clone the package and run the setup.py everything should be installed, and you can then run python3 __init__.py from the main folder. You can also possibly run pip3 install LatticeModelMashup and then just type latticeMash into the terminal, though I haven't tested this yet.

To facilitate rapid testing, there are a few keyboard shortcuts:

  • E starts a dynamic run. The length is determined by the 'frames' in the bottom right.
  • Esc interrupts the current run, or closes the app if nothing is running. (Closing is pretty buggy.)
  • Q clears the screen and adds some noise, determined by the coverage.
  • 1 turns the stochastic noise engine on and off
  • 2 turns the Life engine on and off
  • Z steps forward one frame
  • B paints the background with a cellular automaton
  • WASD controlls the 'coverage' aka how much noise is added when you clear the scren and 'beta', which determines how noise the simulation is while running.
  • XC controls the maximum FPS it will operate at. The two FPS values given at the top are the current performance of the two main engines, and the actual FPS is always limited to the lowest of these three values.
  • Alt brings the focus out of a textbox, so you can use the keyboard shortcuts again after editing something.

A note on the update rules: currently rules of the following sort are permitted,

a <= NB <= b

where a and b are the maximum and minimum number of neighbours (NB) that a cell can have and survive. So if a=1 and b=8 a cell will always survive. Standard Conway rules say cells survive with 2 or 3 neighbors.

c <= P <= d

where c and d are the number of cells that, when surrounding an empty cell, will give birth (P -- 'parents') to a new cell. In Conway P=3.

So the standard Conway rule is '2,3,3,3;'.

Liberal parentage (c = 1,2) results in explosive growth. Unbounded parentage (d=6,7,8) results in violently oscillating populations when coupled with normal death rules.

Rules can also be chained, so for example 2,2,3,5;2,3,2,3;2,4,3,5;2,3,4,5; is a rad little combo that will result in a different update rule every frame in a cycle of four frames. Mix it with a good serving of noise at the start.

Turning the Ising model off (1) will result in deterministic runs, symmetrical if there was no noise at the start.

The little area with the letters 'UB, LB, RB, WB, DB' is meant to be a sort of drawing of the screen-- the lines represent the edges. Anyway, here is where you control the boundary conditions. 1 means that boundary is fixed on, 0 fixed off and -1 means it is invisible (so the UB and DB wrap as do LB and RB, while WB ('wolfbound') just paints without interacting).

About the models

The app is currently based on the following models:

  • Ising Model nice long-term behaviour when undisturbed by Conway, this model is rather overshadowed by the Life engine and tends only to act as a (very expensive) stochastic noise generator. Turn off conway (2) and turn up beta (D) and let it run for a while to see Ising at work.
  • Conway's GoL actually the engine is what they call 'Life-like' and can accept almost arbitrary rulesets. The rules are entered into the green box on the left. Some suggestions are below. Conway-style Life
  • Cellular Automata Wolfram-style cellular automata can be painted on the screen (B), and a scroller is also available that will either wipe out all the cells or paint on full cells. Currently there is no meaningful interaction between the 2D automata and the other models, it is largely aesthetic. Lets see what becomes of it. Advanced rules make more developed lifeforms
  • Potts Model is actually in there, or it was, but has been depreceated. This is a nice version of Ising with more states, but currently the models only have 2 states so this is inactive. Might bring it back.

Features in Version 1

  • Ising model
  • Life-like automata with time-varying rules
  • 'Wolfram' 2D automata painter
  • Arbitrary boundary conditions on top, sides and scroller
  • Colors!
  • Basic recording function (makes gifs, very buggy)

Features coming in Version 2

  • Dynamic update of settings without having to restart
  • Fancy shader graphics
  • Faster engines, better integrated with one another
  • Analytic engine, so you can automatically characterise different update rules
  • Easy interaction, can paint different initial conditions onto the canvas
  • Good support for exporting videos/ gifs

Features planned:

  • The fanciest graphics
  • Automatic monsterfinder (looks for repeating patters with different update rules)
  • More models! Including:
  • Prisoners Dilemma
  • Eden Model

Here you can see the 'Wolfram' painter in the background

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

LatticeModelMashup-0.98.3.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

LatticeModelMashup-0.98.3-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file LatticeModelMashup-0.98.3.tar.gz.

File metadata

  • Download URL: LatticeModelMashup-0.98.3.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for LatticeModelMashup-0.98.3.tar.gz
Algorithm Hash digest
SHA256 0c9a6e47965ee1dd01604db5dc3d7918a2d4768fd55d23c1eed8d6c7300c2472
MD5 3b59082aed26f14989a3a988c255a883
BLAKE2b-256 c0e11f9a2c777c3aa3fa66b659067269de73f27890daba80b001bdb15da2e072

See more details on using hashes here.

File details

Details for the file LatticeModelMashup-0.98.3-py3-none-any.whl.

File metadata

  • Download URL: LatticeModelMashup-0.98.3-py3-none-any.whl
  • Upload date:
  • Size: 31.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for LatticeModelMashup-0.98.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2bd55bd60281c46fdb1c34373b2ed5a3cfdb55b1e17ca7430624ec720ed3c799
MD5 4333b21e9cce4ed77c9d7a36cf605c52
BLAKE2b-256 335845e2ed46170fd2f6afdea1c616748da5ea9e1e2a035d970d87684a6667c3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page