Cell: This class abstract the cell used in 1D CA. Cell should have atleast the following members:
currentState: current state of a cell
nextState(): next state of a cell
Left(): left neighbor
Right(): right neighbor
SetNeighbor(Cell left, Cell right):sets neighboring cells of a cell
SetState(int state):set the current state of a cell
nextState(DecToBinArray ruleSet): calculate the state of a cell for next generation
updateState():updates currrent state for next generation
this is what I have so far. Kind of lost how I should implement the class. The class cell is one of 3 I need to do. I just need help getting started. Some guidance of how to approach this problem?
public class Cell extends DecToBinArray{
private int l;
private int r;
private int s= null;
public int currentState()
public char left(char l){return l;}
public char right(char r){return r;}
public void setNeighbors(Cell left, Cell right){ l =left; r =right;}
public void setState(int state){
if(s.equals(state)){
return false;
}else{
state = s;
return true
}
public int nextState(DecToBinArray ruleSet)
public int updateState()
}
Edited by neshkid123, 14 October 2011 - 02:35 PM.


Sign In
Create Account


Back to top









