Skip to content

A Java program to estimate the value of the percolation threshold via Monte Carlo simulation.

Notifications You must be signed in to change notification settings

jiajunye/Percolation-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Percolation Simulation

A Java program to estimate the value of the percolation threshold via Monte Carlo simulation and draw pixel images.

  • Wrote a Java program to estimate the value of the percolation threshold via Monte Carlo simulation and draw pixel images
  • Modeled an N-by-N sites percolation system. Created a data type Percolation using the Weighted Quick-Union algorithm with various Java APIs.
  • Perform a series of computational experiments, calculated mean and standard deviation of percolation threshold.
  • Took precode text files as inputs to draw pixel images dynamically by utilizing percolation system.

Download the zip file. Extract and open all .java files in src directory using an IDE (Eclipse, Xcode, etc).

Compile and run PercolationStats.java to calculate mean and standard deviation of percolation threshold.

Choose text file from draw directory to be the input file for PercolationVisualizer.java's main method. Compile and run PercolationVisualizer to draw pixel images dynamically.

Run InteractivePercolationVisualizer.java to open a size N grid window to allow user repeatedly clicks sites to open with the mouse. After each site is opened, it draws full sites in light blue, open sites (that aren't full) in white, and blocked sites in black.

About

A Java program to estimate the value of the percolation threshold via Monte Carlo simulation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages