|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--de.tubs.cs.sc.casim.Lattice
|
+--de.tubs.cs.sc.casim.CALattice
|
+--de.tubs.cs.sc.casim.Lattice2D
represents a two dimensional Lattice of cells. All cells are arranged in rows and columns. The data structure is a two dimensional array of Cells. Lattice2D is the common base class for all tow dimensional lattices like triangular, square and hexagonal. These subclasses use the same data structure but different mappings for drawing and neighborhood conditions.
Lattice,
Cell,
Serialized Form| Field Summary | |
protected boolean |
backingUp
the current state of transitioning. |
protected de.tubs.cs.sc.casim.Cell[][] |
cells
|
protected boolean |
transitioning
|
| Fields inherited from class de.tubs.cs.sc.casim.CALattice |
neighborhoodIndexes |
| Fields inherited from class de.tubs.cs.sc.casim.Lattice |
boundaryHandler, lx, ly, lz |
| Constructor Summary | |
Lattice2D(java.lang.Class state,
de.tubs.cs.sc.casim.LatticeDefinition ldef)
Constructor creates the two dimensional array of cells and 4 BoundaryHandler calls reset to initialize all cells |
|
| Method Summary | |
protected void |
backup()
calls backup for each cell |
int |
getDimension()
|
protected de.tubs.cs.sc.casim.State |
getNeighborRelative(de.tubs.cs.sc.casim.Cell cell,
int x,
int y,
int z)
returns the relative neighbor of cell with given relative coordinates. |
protected de.tubs.cs.sc.casim.State[] |
getNeighborsArbitrary(de.tubs.cs.sc.casim.Cell cell)
returns a previously defined arbitrary neighborhood. |
de.tubs.cs.sc.casim.State |
getOldState(int x,
int y,
int z)
returns the old state at the given coordinates. |
de.tubs.cs.sc.casim.State |
getState(int x)
always throws a RuntimeException |
de.tubs.cs.sc.casim.State |
getState(int x,
int y)
returns the current state at the given coordinates. |
de.tubs.cs.sc.casim.State |
getState(int x,
int y,
int z)
returns the current state at the given coordinates. |
protected void |
reset()
reallocates all cells and calls again State.initialize for one cell |
protected void |
setIs(int i1,
int i2)
Set the position in the lattice for neighborhood accesses. |
java.lang.String |
toString()
|
void |
transition()
calls transition for each cells state |
| Methods inherited from class de.tubs.cs.sc.casim.CALattice |
defineNeighborsArbitrary, getNeighbors, getNeighborsMoore, getNeighborsMoore, getNeighborsvonNeumann, getNeighborsvonNeumann, getNrOfNeighbors, reversetransition |
| Methods inherited from class de.tubs.cs.sc.casim.Lattice |
addBoundaryHandler, beginBlock, callAnalyze, callInitialize, endBlock, finish, getBoundaryHandler, getDefinition, getStateClass, getX, getY, getZ, setNeighborhood, waitForReadyForBackup, waitForReadyForTransition |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected de.tubs.cs.sc.casim.Cell[][] cells
protected boolean backingUp
protected boolean transitioning
| Constructor Detail |
public Lattice2D(java.lang.Class state,
de.tubs.cs.sc.casim.LatticeDefinition ldef)
throws CAException
state - the Java class of the State of the cells of the latticeldef - the LatticeDefinition with further lattice parameters| Method Detail |
public final int getDimension()
getDimension in class Lattice
protected void reset()
throws CAException
reset in class LatticeCAExceptionpublic de.tubs.cs.sc.casim.State getState(int x)
getState in class LatticeLattice1D.getState(int)
public de.tubs.cs.sc.casim.State getState(int x,
int y)
getState in class Lattice
public de.tubs.cs.sc.casim.State getState(int x,
int y,
int z)
Lattice
getState in class LatticeLattice3D.getState(int)
public de.tubs.cs.sc.casim.State getOldState(int x,
int y,
int z)
getOldState in class LatticeCell.getNeighbors(),
BoundaryHandler.getOutsideState(int)
protected de.tubs.cs.sc.casim.State getNeighborRelative(de.tubs.cs.sc.casim.Cell cell,
int x,
int y,
int z)
getNeighborRelative in class CALatticeCALattice.getNeighbors(de.tubs.cs.sc.casim.Cell)protected de.tubs.cs.sc.casim.State[] getNeighborsArbitrary(de.tubs.cs.sc.casim.Cell cell)
getNeighborsArbitrary in class CALatticeCALattice.getNeighbors(de.tubs.cs.sc.casim.Cell)protected void backup()
backup in class LatticeLattice.backup()public void transition()
transition in class LatticeLattice.transition()public java.lang.String toString()
toString in class java.lang.Object
protected void setIs(int i1,
int i2)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||