|
|||||||||
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
base class of all Lattice's defines abstract interface used by CALocal and common implementation most relevant code is implemented in subclasses.
Field Summary | |
protected de.tubs.cs.sc.casim.BoundaryHandler[] |
boundaryHandler
|
protected int |
lx
|
protected int |
ly
|
protected int |
lz
|
Constructor Summary | |
Lattice(java.lang.Class state,
de.tubs.cs.sc.casim.LatticeDefinition ldef)
Constructor of Lattice A Lattice object cannot be instanciated directly, the subclasses must be used. |
Method Summary | |
void |
addBoundaryHandler(de.tubs.cs.sc.casim.BoundaryHandler b)
Adds a boundary handler to the lattice. |
protected abstract void |
backup()
is called by CALocal.backup in each generation step after waiting for all boundary handlers readyForBackup. |
protected void |
beginBlock()
methods to indicate the begining and the end of a sequence of ( transition(); backup() )* calls. |
protected void |
callAnalyze()
call the static method analyze of the user-defined class. |
protected void |
callInitialize()
call the static method initialize of the user-defined class. |
abstract void |
defineNeighborsArbitrary(int[][] indexes)
defines an arbitrary neighborhood for the CA |
protected void |
endBlock()
methods to indicate the begining and the end of a sequence of ( transition(); backup() )* calls. |
protected void |
finish()
Possibility to do some cleanup work before the lattice is discarded. |
de.tubs.cs.sc.casim.BoundaryHandler |
getBoundaryHandler(int dim,
boolean dir)
|
protected de.tubs.cs.sc.casim.LatticeDefinition |
getDefinition()
|
abstract int |
getDimension()
|
abstract de.tubs.cs.sc.casim.State |
getOldState(int x,
int y,
int z)
returns the old state at the given coordinates. |
abstract de.tubs.cs.sc.casim.State |
getState(int x)
returns the current state at the given coordinates. |
abstract de.tubs.cs.sc.casim.State |
getState(int x,
int y)
returns the current state at the given coordinates. |
abstract de.tubs.cs.sc.casim.State |
getState(int x,
int y,
int z)
returns the current state at the given coordinates. |
protected java.lang.Class |
getStateClass()
|
int |
getX()
|
int |
getY()
|
int |
getZ()
|
protected abstract void |
reset()
resets the lattice back into start condition of all cells |
protected abstract void |
reversetransition()
is called by CALocal.doBackStep in each generation step back Subclasses call reversetransition for each block of States of the lattice. |
void |
setNeighborhood(int type,
int radius)
|
protected abstract void |
transition()
is called by CALocal.doStep in each generation step after waiting for all boundary handlers readyForTransition. |
protected void |
waitForReadyForBackup(int iGeneration)
called before any backup, waits for all BoundaryHandler.readyForBackup until a real backup can be processed. |
protected void |
waitForReadyForTransition(int iGeneration)
called before any backup, waits for all BoundaryHandler.readyForTransition until a real transition can be processed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int lx
protected int ly
protected int lz
protected de.tubs.cs.sc.casim.BoundaryHandler[] boundaryHandler
Lattice1D
,
Lattice2D
,
Lattice3D
Constructor Detail |
public Lattice(java.lang.Class state, de.tubs.cs.sc.casim.LatticeDefinition ldef) throws CAException
Lattice1D.Lattice1D(java.lang.Class, de.tubs.cs.sc.casim.LatticeDefinition)
,
Lattice2DTriangle.Lattice2DTriangle(java.lang.Class, de.tubs.cs.sc.casim.LatticeDefinition)
,
Lattice2DSquare.Lattice2DSquare(java.lang.Class, de.tubs.cs.sc.casim.LatticeDefinition)
,
Lattice2DHexagonal.Lattice2DHexagonal(java.lang.Class, de.tubs.cs.sc.casim.LatticeDefinition)
,
Lattice3D.Lattice3D(java.lang.Class, de.tubs.cs.sc.casim.LatticeDefinition)
Method Detail |
public final void addBoundaryHandler(de.tubs.cs.sc.casim.BoundaryHandler b)
Lattice
,
BoundaryHandler
public de.tubs.cs.sc.casim.BoundaryHandler getBoundaryHandler(int dim, boolean dir)
public abstract int getDimension()
protected java.lang.Class getStateClass()
public final int getX()
public final int getY()
public final int getZ()
protected final de.tubs.cs.sc.casim.LatticeDefinition getDefinition()
LatticeDefinition
public abstract de.tubs.cs.sc.casim.State getState(int x)
public abstract de.tubs.cs.sc.casim.State getState(int x, int y)
public abstract de.tubs.cs.sc.casim.State getState(int x, int y, int z)
public abstract de.tubs.cs.sc.casim.State getOldState(int x, int y, int z)
Cell.getNeighbors()
,
BoundaryHandler.getOutsideState(int)
protected abstract void backup()
Cell.backup()
,
State.copy(de.tubs.cs.sc.casim.State)
,
BoundaryHandler.readyForBackup(int)
protected abstract void transition()
Cell.transition()
,
State.transition(de.tubs.cs.sc.casim.Cell)
,
BoundaryHandler.readyForTransition(int)
protected abstract void reversetransition()
BlockState.reversetransition(de.tubs.cs.sc.casim.BlockState[])
protected void waitForReadyForBackup(int iGeneration)
backup()
,
BoundaryHandler.readyForBackup(int)
protected void waitForReadyForTransition(int iGeneration)
transition()
,
BoundaryHandler.readyForTransition(int)
public abstract void defineNeighborsArbitrary(int[][] indexes)
public final void setNeighborhood(int type, int radius)
LatticeDefinition
protected abstract void reset() throws CAException
CAException
protected void beginBlock()
protected void endBlock()
protected void callInitialize()
protected void callAnalyze()
protected void finish()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |