|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.tubs.cs.sc.casim.State
The State class is the base class for all cellular automata. You must inherit a subclass and override appropriate methods
TableState
,
BlockState
,
Serialized FormConstructor Summary | |
State()
|
Method Summary | |
abstract void |
copy(de.tubs.cs.sc.casim.State s)
is called before transition for every cell do a field to field copy from s to this |
boolean |
equals(java.lang.Object obj)
Default implementation for virtual Object.equals |
java.awt.Color |
getColor()
returns the draw Color of the cell depending on the state or condition. |
java.lang.Object |
getComponent(int i)
returns the i-th component of the state, as derived from the automatic translation from CDL. |
de.tubs.cs.sc.casim.State |
getConstant()
if the state class is used in lattices with constant boundary conditions, it should return the constant state the base class implementation returns null |
de.tubs.cs.sc.casim.State |
getConstant(int dim,
boolean dir)
if the state class is used in lattices with constant boundary conditions, it should return the constant state, here dependent on the boundary direction. |
java.awt.image.ImageProducer |
getIcon()
returns the icon with which the cell should be drawn. |
static void |
globalTransition()
is called after backup once to change global (static) variables |
int |
hashCode()
Default implementation returns the RGB value. |
static void |
initialize(de.tubs.cs.sc.casim.Lattice l)
is called only once the base class implementation does nothing |
static void |
initialize(de.tubs.cs.sc.casim.Lattice l,
int option)
is called only once to initialize all cells. |
java.lang.String |
toString()
Default implementation returns empty String. |
abstract void |
transition(de.tubs.cs.sc.casim.Cell cell)
is called after backup for every cell evaluate the new state of the cell use neighborhood methods of cell to get the neighborhood conditions |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public State()
Method Detail |
public static void initialize(de.tubs.cs.sc.casim.Lattice l, int option)
l
- Lattice throough which all cells can be accessed.option
- An optional integer that can indicate different initial
conditions.
the base class implementation does nothingpublic static void initialize(de.tubs.cs.sc.casim.Lattice l)
public java.awt.Color getColor()
public java.awt.image.ImageProducer getIcon()
public abstract void copy(de.tubs.cs.sc.casim.State s)
public abstract void transition(de.tubs.cs.sc.casim.Cell cell)
Cell
public static void globalTransition()
public de.tubs.cs.sc.casim.State getConstant()
public de.tubs.cs.sc.casim.State getConstant(int dim, boolean dir)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object getComponent(int i)
i
- number of the component (starting with 0).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |