de.tubs.cs.sc.casim
Class BlockState

java.lang.Object
  |
  +--de.tubs.cs.sc.casim.State
        |
        +--de.tubs.cs.sc.casim.BlockState
All Implemented Interfaces:
java.io.Serializable

public abstract class BlockState
extends State

is used to declare a CA as a BlockCA CASim detects that a class extends State and BlockState. The difference to a standard CA is the implemenation of this abstract class. BlockState describes what blocks should be used for transition, the transition function and the reverse transition function.

See Also:
Serialized Form

Constructor Summary
BlockState()
           
 
Method Summary
 void copy(de.tubs.cs.sc.casim.State s)
          the copy method is not needed for Block CA's, so it's final to prevent further overwritings, throws always an exception
abstract  int[][][] getBlocks(int dim)
          defines a cell pattern describing which cell indexes should be used as blocks.
abstract  void reversetransition(de.tubs.cs.sc.casim.BlockState[] states)
          the reverse transition function for Block CA's
abstract  void transition(de.tubs.cs.sc.casim.BlockState[] states)
          the transition function for Block CA's
 void transition(de.tubs.cs.sc.casim.Cell cell)
          the transition(Cell cell) method is not needed for Block CA's, so it's final to prevent further overwritings, throws always an exception
 
Methods inherited from class de.tubs.cs.sc.casim.State
equals, getColor, getComponent, getConstant, getConstant, getIcon, globalTransition, hashCode, initialize, initialize, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlockState

public BlockState()
Method Detail

getBlocks

public abstract int[][][] getBlocks(int dim)
                             throws java.lang.IllegalArgumentException
defines a cell pattern describing which cell indexes should be used as blocks. The first index is the block no. The next indexes are an array of {x,y,z} coordinate triples. A BlockState should throw an IllegalArgumentException if it will not support any specific dimension.

Returns:
an array of indexes
java.lang.IllegalArgumentException

transition

public abstract void transition(de.tubs.cs.sc.casim.BlockState[] states)
the transition function for Block CA's


reversetransition

public abstract void reversetransition(de.tubs.cs.sc.casim.BlockState[] states)
the reverse transition function for Block CA's


copy

public final void copy(de.tubs.cs.sc.casim.State s)
the copy method is not needed for Block CA's, so it's final to prevent further overwritings, throws always an exception

Specified by:
copy in class State

transition

public final void transition(de.tubs.cs.sc.casim.Cell cell)
the transition(Cell cell) method is not needed for Block CA's, so it's final to prevent further overwritings, throws always an exception

Specified by:
transition in class State
See Also:
Cell