org.opensourcephysics.sip.ch14.ca
Class LifeApp

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

public class LifeApp
extends AbstractSimulation

LifeApp implements the "Game of Life" invented by John Conway and popularized by Martin Gardner in his Mathemtatical Recreations column in Scientific American. (October 1970)


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
LifeApp()
          Constructs the LifeApp.
 
Method Summary
 void clear()
          Clears all cells.
 void doStep()
          Step the Lattice by one generation.
 void initCells(int size)
          Initialzie the game of life.
 void initialize()
          Set the default parameters in the control.
static void main(java.lang.String[] args)
           
 void reset()
          Sets the default parameters in the control.
 
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, stopRunning, 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

LifeApp

public LifeApp()
Constructs the LifeApp.

Method Detail

initCells

public void initCells(int size)
Initialzie the game of life.


clear

public void clear()
Clears all cells.


reset

public void reset()
Sets the default parameters in the control.

Overrides:
reset in class AbstractSimulation

initialize

public void initialize()
Set the default parameters in the control.

Overrides:
initialize in class AbstractSimulation

doStep

public void doStep()
Step the Lattice by one generation.

Specified by:
doStep in class AbstractAnimation

main

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