benliepert / RDLA

Diffusion Limited Aggregation in Rust

Home Page:https://benliepert.github.io/RDLA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Diffusion Limited Aggregation in Rust

What is it?

A live, configurable, simulator of Diffusion Limited Aggregation (DLA). DLA is the clustering of particles undergoing a random walk due to Brownian motion.

The core algorithm is simple:

  1. Initialize a 2d/3d space with at least 1 position marked as "filled" (occupied by a particle).
  2. Spawn a particle at an "unfilled" position.
  3. Simulate a random walk for said particle until it's directly adjacent (touching) an existing particle, at which point it will "stick" and "fill" its current position in the space.
  4. Repeat steps 2 and 3 until you've reached a desired number of particles, or the grid is full (and executing step 2 is no longer possible).

In this simulator, DLA is modeled on a 2d space in Rust using a Pixels frame buffer and egui GUI.

How To Run

Visit benliepert.github.io/RDLA for a version (generated with trunk) that runs in your browser.
Or you can build and run the standalone app by using cargo run --release at the root of this repo.

Acknowledgments

Thanks @parasyte for your Conway's Game of Life, Minimal Egui, and Minimal Web examples!

About

Diffusion Limited Aggregation in Rust

https://benliepert.github.io/RDLA


Languages

Language:Rust 93.4%Language:HTML 5.4%Language:JavaScript 0.7%Language:Shell 0.5%