de.tubs.cs.sc.casim
Class BlockLattice

java.lang.Object
  |
  +--de.tubs.cs.sc.casim.Lattice
        |
        +--de.tubs.cs.sc.casim.BlockLattice
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BlockLattice1D, BlockLattice2D, BlockLattice3D

public abstract class BlockLattice
extends Lattice
implements java.io.Serializable

Base class for all block lattices. This group of classes implements Block CA's lattices. BlockLattice implements initialization, definition of blocks access to the States, a transition function and a reverse transition function.

See Also:
Serialized Form

Field Summary
protected  int[][] blockDims
           
protected  int blockNo
           
protected  int[][][] blocks
           
protected  de.tubs.cs.sc.casim.BlockState[] blockStates
           
 
Fields inherited from class de.tubs.cs.sc.casim.Lattice
boundaryHandler, lx, ly, lz
 
Constructor Summary
BlockLattice(java.lang.Class state, de.tubs.cs.sc.casim.LatticeDefinition definition)
          Constructor Base class for all block lattices only calls Lattice constructor an initializes everything to zero.
 
Method Summary
protected  void backup()
          does nothing, because Block CA's don't need any backup of cells and store only one state array
 void defineNeighborsArbitrary(int[][] indexes)
          neighborhoods are not allowed for Block CA's it's only for the Lattice interface.
protected  void initBlock()
          initializes all block specific arrays and dimensions of blocks.
protected  void reset()
          Base class reset only resets blockNo.
protected  void reversetransition()
          base class reversetransition of Block CA decreases blockCounter and swaps back to blocks length if all blocks are rounded.
protected  void transition()
          base class transition of Block CA increases blockCounter and swaps back to zero if all blocks are rounded.
 
Methods inherited from class de.tubs.cs.sc.casim.Lattice
addBoundaryHandler, beginBlock, callAnalyze, callInitialize, endBlock, finish, getBoundaryHandler, getDefinition, getDimension, getOldState, getState, getState, getState, getStateClass, getX, getY, getZ, setNeighborhood, waitForReadyForBackup, waitForReadyForTransition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blocks

protected int[][][] blocks

blockStates

protected transient de.tubs.cs.sc.casim.BlockState[] blockStates

blockDims

protected int[][] blockDims

blockNo

protected int blockNo
Constructor Detail

BlockLattice

public BlockLattice(java.lang.Class state,
                    de.tubs.cs.sc.casim.LatticeDefinition definition)
             throws CAException
Constructor Base class for all block lattices only calls Lattice constructor an initializes everything to zero. State Array and Blocks will be created in subclass constructors.

Method Detail

initBlock

protected void initBlock()
                  throws CAException
initializes all block specific arrays and dimensions of blocks. Base class implementation does everything and is used by subclasses constructors to init their blocks. The dimension of all blocks are checked and stored in blockDims.

CAException

backup

protected void backup()
does nothing, because Block CA's don't need any backup of cells and store only one state array

Specified by:
backup in class Lattice
See Also:
Cell.backup(), State.copy(de.tubs.cs.sc.casim.State), BoundaryHandler.readyForBackup(int)

reset

protected void reset()
              throws CAException
Base class reset only resets blockNo. Subclasses should call BlockLattice.reset in their overridden reset.

Specified by:
reset in class Lattice
CAException

transition

protected void transition()
base class transition of Block CA increases blockCounter and swaps back to zero if all blocks are rounded. Subclasses do the real transition.

Specified by:
transition in class Lattice
See Also:
Cell.transition(), State.transition(de.tubs.cs.sc.casim.Cell), BoundaryHandler.readyForTransition(int)

reversetransition

protected void reversetransition()
base class reversetransition of Block CA decreases blockCounter and swaps back to blocks length if all blocks are rounded. Subclasses do the real reversetransition.

Specified by:
reversetransition in class Lattice
See Also:
BlockState.reversetransition(de.tubs.cs.sc.casim.BlockState[])

defineNeighborsArbitrary

public void defineNeighborsArbitrary(int[][] indexes)
neighborhoods are not allowed for Block CA's it's only for the Lattice interface.

Specified by:
defineNeighborsArbitrary in class Lattice