Skip to main content

Lattice gas automata implemented in Python.

Project description

Lattice Gas Cellular Automata

This project focuses on the declarative implementation of the popular Lattice Gas Cellular Automata listed below. Models with checked names are implemented and ready to use.

  • HPP
  • FHP I
  • FHP II
  • FHP III

Currently, all the models are fully implemented, so feel free to test them.

Application GUI

Application window when the following commands were called:

lgca --model-name=HPP --pattern=wiki --steps=640 --run

HPP, obstacle, step 250 <

lgca --model-name=FHPII --pattern=obstacle --steps=250 --run

FHP II, obstacle, step 250 <

Installation

Install using pip (creating a Python virtual environment first is strongly recommended).

pip install lgca

Usage

To get some information about the application just run:

lgca --help

and You should see something like below.

pygame 2.5.2 (SDL 2.28.3, Python 3.12.7)
Hello from the pygame community. https://www.pygame.org/contribute.html
Usage: lgca [OPTIONS]

  Lattice Gas Cellular Automata [X] HPP [X] FHP I [X] FHP II [ ] FHP III

Options:
  -v, --value INTEGER RANGE       Content value.  [default: 0; 0<=x<=255]
  -n, --model-name [HPP|FHPI|FHPII|FHPIII|hpp|fhpi|fhpii|fhpiii]
                                  Model name.  [default: HPP]
  -w, --width INTEGER             Lattice window width.  [default: 300]
  -h, --height INTEGER            Lattice window height.  [default: 200]
  -s, --steps INTEGER             Number of steps.  [default: -1]
  -r, --run                       Run immediately.
  -d, --deterministic             Generate the same randomized result for the
                                  same params.  [default: True]
  -p, --pattern [wiki|random|alt|single|obstacle|test]
                                  Select initial state pattern.  [default:
                                  wiki]
  --help                          Show this message and exit.

So the sample usage can look like this

lgca --run

The above command should display the HPP model visualization, identical to the one on Wikipedia.

https://en.wikipedia.org/wiki/HPP_model

  • To start/stop the application just press the space button.
  • To reset app to the initial state press the S button.
  • To quit the app pres ESC button or quit the window.

Status

build status

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

lgca-0.1.9.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lgca-0.1.9-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

Details for the file lgca-0.1.9.tar.gz.

File metadata

  • Download URL: lgca-0.1.9.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for lgca-0.1.9.tar.gz
Algorithm Hash digest
SHA256 7432d3bdc39f9a34436278c1360945430ef7e8449f4bb9595013f4a3a300b2c7
MD5 4ee08dd2564a5a27c88729716854b784
BLAKE2b-256 3120bd3756e3834033cc8986c3ffe90666b51150eab2aea178304d21e1340e34

See more details on using hashes here.

Provenance

The following attestation bundles were made for lgca-0.1.9.tar.gz:

Publisher: python-publish.yml on siciarek/lgca

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lgca-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: lgca-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 47.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for lgca-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 3e3f2143c4d6bfe3c21ed7d8c07aa8475d69512c61120c39765e929b05fa4724
MD5 9016c02bd8b55649afbb6825a6bda88b
BLAKE2b-256 8b5dcfd415ace685b2dd2f83b270432409468514ae17df434b631be9ddfacb1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for lgca-0.1.9-py3-none-any.whl:

Publisher: python-publish.yml on siciarek/lgca

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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