Skip to content

tangjm/percolationanimation

Repository files navigation

Percolation threshold visualisation

A project that visualises percolation through a 2D grid.

Example percolation grid Example percolation grid

Setup for local development

# Install dependencies
npm install 

# Compile to Javascript
npx tsc

# Open index.html in your browser 

Features

  • Basic visualisation

UI

  • Custom settings
    • Choose number of trials
    • Change grid size
    • Change size of each site
  • Invert colours
  • Revert to previous positions
  • Option to run simulations in parallel or in sequence.
  • Add option to randomise settings
  • Add presets
  • Congifure simulation speed
  • Fix backfill problem

Statistics

  • Add statistics for the percolation threshold
  • Mean threshold
  • Standard deviation for the threshold
  • Have multiple instances of the percolation grid and perform many Monte Carlo simulations to estimate the percolation threshold.

Learning goals

  • Union Find data structure
  • Canvas API
  • Sequencing animations with delays between them by using the Async/Await syntax and setTimeout.
  • Opportunity to try out Typescript

About

A project that visualises percolation through a 2D grid.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors