|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.tubs.cs.sc.casim.Cell
The class Cell represents and capsulates one cell in the Cellular automatas lattice. This class is used for any kind of lattice. It has it's coordinates, a reference the lattice containing the cell and two references to a State class object as data members. For faster simulation each cell has two State[]s of references for the von Neumann and Moore Neighborhood with radius one, because the neighborhood of a cell will not be changed during simulation. The first state reference is the current one. The second is used as backup copy for the neighborhoods. In each generation of the Cellular Automata a copy is made from the current state to the backup state
CALattice
,
State
,
Serialized FormField Summary | |
protected de.tubs.cs.sc.casim.CALattice |
lattice
a reference to the lattice containing this cell, necessary for the neighborhood calculation |
protected int |
x
position of the cell in th elattice |
protected int |
y
position of the cell in th elattice |
protected int |
z
position of the cell in th elattice |
Constructor Summary | |
Cell(de.tubs.cs.sc.casim.CALattice l,
java.lang.Class state,
int x,
int y,
int z)
Cell constructor sets Lattice reference, creates the two states, current and backup. |
Method Summary | |
void |
backup()
copies the current state into the backup state called during a generation step of the Cellular Automat |
de.tubs.cs.sc.casim.State |
getNeighborRelative(int x)
Returns a relative neighbor only useful for one dimensional lattices.getNeighborRelative(int x) returns null for two or three dimensional lattices. |
de.tubs.cs.sc.casim.State |
getNeighborRelative(int x,
int y)
Returns a relative neighbor only useful for two dimensional lattices. |
de.tubs.cs.sc.casim.State |
getNeighborRelative(int x,
int y,
int z)
Returns a relative neighbor only useful for three dimensional lattices. |
de.tubs.cs.sc.casim.State[] |
getNeighbors()
getNeighbors uses the settings of the parent lattice for calculation the neighborhood The neighborhood is calculated only once and cached in the cell. |
de.tubs.cs.sc.casim.State[] |
getNeighborsMoore()
|
de.tubs.cs.sc.casim.State[] |
getNeighborsMoore(int r)
|
de.tubs.cs.sc.casim.State[] |
getNeighborsvonNeumann()
|
de.tubs.cs.sc.casim.State[] |
getNeighborsvonNeumann(int r)
|
de.tubs.cs.sc.casim.State |
getOldState()
|
de.tubs.cs.sc.casim.State |
getState()
|
void |
onlyOneState()
|
java.lang.String |
toString()
|
void |
transition()
the transition from generation n to generation n+1 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected transient de.tubs.cs.sc.casim.CALattice lattice
protected final int x
protected final int y
protected final int z
Constructor Detail |
public Cell(de.tubs.cs.sc.casim.CALattice l, java.lang.Class state, int x, int y, int z) throws CAException
Method Detail |
public de.tubs.cs.sc.casim.State[] getNeighbors()
LatticeDefinition
public de.tubs.cs.sc.casim.State[] getNeighborsvonNeumann(int r)
public de.tubs.cs.sc.casim.State[] getNeighborsMoore(int r)
public de.tubs.cs.sc.casim.State[] getNeighborsvonNeumann()
public de.tubs.cs.sc.casim.State[] getNeighborsMoore()
public de.tubs.cs.sc.casim.State getNeighborRelative(int x, int y, int z)
public de.tubs.cs.sc.casim.State getNeighborRelative(int x, int y)
public de.tubs.cs.sc.casim.State getNeighborRelative(int x)
public de.tubs.cs.sc.casim.State getState()
public de.tubs.cs.sc.casim.State getOldState()
public void onlyOneState()
public void backup()
Lattice.transition()
public void transition()
Lattice.transition()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |