org.generation5.demos
Class ConwaysLifeCA

java.lang.Object
  extended byorg.generation5.bio.CellularAutomata
      extended byorg.generation5.demos.ConwaysLifeCA
All Implemented Interfaces:
Steppable, Visualizable

public class ConwaysLifeCA
extends CellularAutomata

This class implements Conway's Life using the CellularAutomata classes and double-buffering for speed.


Field Summary
 
Fields inherited from class org.generation5.bio.CellularAutomata
bufferPosition, bufferSize, caSize, caWorld, caWorld_x, caWorld_y, clrBackground, clrGrid, clrWorld, DOUBLE_BUFFERING, doubleBuffering, drawGrid, ENCLOSED, geometryType, INFINITE, TORODIAL, X_AXIS, Y_AXIS
 
Constructor Summary
ConwaysLifeCA()
          Default constructor
ConwaysLifeCA(int size_x, int size_y)
          Constructor with size initializors.
 
Method Summary
 void doStep()
          Advance the world one timestep.
 void init()
          Randomly initializes the world.
static void main(java.lang.String[] args)
          Standard test function using iterateCA.
 
Methods inherited from class org.generation5.bio.CellularAutomata
clearWorld, drawGrid, flipBuffer, getBackgroundColor, getCASize, getGeometry, getSizeX, getSizeY, getWorldAt, iterateCA, iterateCA, render, reset, setBackgroundColor, setCASize, setGeometry, setWorldAt, setWorldAtEx, setWorldAtRelative, setWorldColors, setWorldColour, setWorldSize, translateGeometry, writeImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConwaysLifeCA

public ConwaysLifeCA()
Default constructor


ConwaysLifeCA

public ConwaysLifeCA(int size_x,
                     int size_y)
Constructor with size initializors.

Parameters:
size_x - the x-size of the world.
size_y - the y-size of the world.
Method Detail

doStep

public void doStep()
Advance the world one timestep.

Specified by:
doStep in interface Steppable
Specified by:
doStep in class CellularAutomata

init

public void init()
Randomly initializes the world.

Specified by:
init in interface Steppable
Specified by:
init in class CellularAutomata

main

public static void main(java.lang.String[] args)
Standard test function using iterateCA.

Parameters:
args - the arguments to be passed on to iterateCA.
See Also:
CellularAutomata.iterateCA(CellularAutomata, String[])

This documentation is part of the Generation5 JDK.