org.opensourcephysics.sip.ch13.cca
Class CCA

java.lang.Object
  extended by org.opensourcephysics.sip.ch13.cca.CCA
All Implemented Interfaces:
Drawable

public class CCA
extends java.lang.Object
implements Drawable

CCA provides simualtes cluster-cluster aggregation


Field Summary
 int[] box
           
 int[] firstParticle
           
 int L
           
 int[] lastParticle
           
 int[] mass
           
 int[] nextParticle
           
 int numberOfClusters
           
 int numberOfParticles
           
 int[][] site
           
 int[] x
           
 int[] y
           
 
Constructor Summary
CCA()
           
 
Method Summary
 void boxCount()
           
 void checkNeighbors(int x_i, int y_i)
          Checks to see if there are two neighbors not in same cluster
 void draw(DrawingPanel panel, java.awt.Graphics g)
          Draws clusters
 void initialize()
          initializes site lattice with single particle clusters randomly placed on the lattice
 void merge(int c1, int c2)
          Merges two clusters that are next to each other
 int occupiedSiteInCell(int cell, int i, int j)
           
 void step()
          Moves a cluster chosen at random in a random direction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

site

public int[][] site

x

public int[] x

y

public int[] y

firstParticle

public int[] firstParticle

nextParticle

public int[] nextParticle

lastParticle

public int[] lastParticle

mass

public int[] mass

L

public int L

numberOfParticles

public int numberOfParticles

numberOfClusters

public int numberOfClusters

box

public int[] box
Constructor Detail

CCA

public CCA()
Method Detail

initialize

public void initialize()
initializes site lattice with single particle clusters randomly placed on the lattice


checkNeighbors

public void checkNeighbors(int x_i,
                           int y_i)
Checks to see if there are two neighbors not in same cluster

Parameters:
x_i,y_i -

merge

public void merge(int c1,
                  int c2)
Merges two clusters that are next to each other

Parameters:
largerCluster,smallerCluster -

step

public void step()
Moves a cluster chosen at random in a random direction


occupiedSiteInCell

public int occupiedSiteInCell(int cell,
                              int i,
                              int j)

boxCount

public void boxCount()

draw

public void draw(DrawingPanel panel,
                 java.awt.Graphics g)
Draws clusters

Specified by:
draw in interface Drawable