org.generation5.demos
Class DictyosteliumCA

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

public class DictyosteliumCA
extends CellularAutomataLayered

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


Field Summary
protected static java.util.Random random
          An instance of java.util.Random.
 
Fields inherited from class org.generation5.bio.CellularAutomataLayered
clrStates, collisionDetection, positionTest
 
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
DictyosteliumCA()
          Create an instance of the Dicty CA.
DictyosteliumCA(int size_x, int size_y)
          Create an instance of the Dicty CA with size information.
 
Method Summary
 void doStep()
          Advance the world forward one time-step.
 void init()
          Initialize the world.
static void main(java.lang.String[] args)
          Runs a test program.
 
Methods inherited from class org.generation5.bio.CellularAutomataLayered
addAutomaton, addAutomaton, getCA, getCollisionDetection, getNumCAs, isCellFree, moveCAAbsolute, moveCARelative, removeAll, render, setCollisionDetection, setStateColour, setWorldSize
 
Methods inherited from class org.generation5.bio.CellularAutomata
clearWorld, drawGrid, flipBuffer, getBackgroundColor, getCASize, getGeometry, getSizeX, getSizeY, getWorldAt, iterateCA, iterateCA, reset, setBackgroundColor, setCASize, setGeometry, setWorldAt, setWorldAtEx, setWorldAtRelative, setWorldColors, setWorldColour, translateGeometry, writeImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

random

protected static java.util.Random random
An instance of java.util.Random.

See Also:
Random
Constructor Detail

DictyosteliumCA

public DictyosteliumCA()
Create an instance of the Dicty CA.


DictyosteliumCA

public DictyosteliumCA(int size_x,
                       int size_y)
Create an instance of the Dicty CA with size information.

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 forward one time-step.

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

init

public void init()
Initialize the world.

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

main

public static void main(java.lang.String[] args)
Runs a test program.


This documentation is part of the Generation5 JDK.