org.opensourcephysics.sip.ch13
Class DLAApp

java.lang.Object
  extended by org.opensourcephysics.controls.AbstractAnimation
      extended by org.opensourcephysics.controls.AbstractSimulation
          extended by org.opensourcephysics.sip.ch13.DLAApp
All Implemented Interfaces:
java.lang.Runnable, Animation, Simulation

public class DLAApp
extends AbstractSimulation

DLAApp displays Diffusion Limited Aggregation (DLA) in a lattice frame. Add code to plot the mass distribution in the stopRunning method.


Field Summary
 
Fields inherited from class org.opensourcephysics.controls.AbstractSimulation
control, showStepsPerDisplay, stepCounter, stepsPerDisplay
 
Fields inherited from class org.opensourcephysics.controls.AbstractAnimation
animationThread, decimalFormat, delayTime, mainFrame
 
Constructor Summary
DLAApp()
           
 
Method Summary
 void doStep()
          Does a simulation step by growing the DLA.
 void initialize()
          Initializes the DLA lattice.
static void main(java.lang.String[] args)
           
 void reset()
          Resets the DLA lattice size.
 void stopRunning()
          Performs an action after the animation stops.
 boolean walk(int x, int y)
          Walk until next to perimeter site.
 
Methods inherited from class org.opensourcephysics.controls.AbstractSimulation
enableStepsPerDisplay, getControl, getLoader, getStepCounter, getStepsPerDisplay, initializeAnimation, resetAnimation, run, setControl, setStepsPerDisplay, start, startAnimation, startRunning, startSimulation, stepAnimation, stop, stopAnimation, stopSimulation
 
Methods inherited from class org.opensourcephysics.controls.AbstractAnimation
addChildFrame, clearChildFrames, getChildFrames, getDelayTime, getMainFrame, getOSPApp, isRunning, setDelayTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensourcephysics.controls.Simulation
isRunning
 

Constructor Detail

DLAApp

public DLAApp()
Method Detail

initialize

public void initialize()
Initializes the DLA lattice.

Overrides:
initialize in class AbstractSimulation

reset

public void reset()
Resets the DLA lattice size.

Overrides:
reset in class AbstractSimulation

stopRunning

public void stopRunning()
Performs an action after the animation stops.

Overrides:
stopRunning in class AbstractSimulation

doStep

public void doStep()
Does a simulation step by growing the DLA. Attempts no more than 100 walkers.

Specified by:
doStep in class AbstractAnimation

walk

public boolean walk(int x,
                    int y)
Walk until next to perimeter site.

Parameters:
x,y - initial walker location

main

public static void main(java.lang.String[] args)