Percolation/Mean cluster density: Difference between revisions
Content added Content deleted
m (Simplified code.) |
m (Final improvment to code.) |
||
Line 943: | Line 943: | ||
private void createGrid(int aGridSize, double aProbability) { |
private void createGrid(int aGridSize, double aProbability) { |
||
⚫ | |||
⚫ | |||
⚫ | |||
for ( int row = 0; row < aGridSize; row++ ) { |
for ( int row = 0; row < aGridSize; row++ ) { |
||
for ( int col = 0; col < aGridSize; col++ ) { |
for ( int col = 0; col < aGridSize; col++ ) { |
||
Line 957: | Line 955: | ||
private int[][] grid; |
private int[][] grid; |
||
private int clusterCount; |
private int clusterCount; |
||
⚫ | |||
private static final int CLUSTERED = -1; |
private static final int CLUSTERED = -1; |