Jump to content

Cellular Automaton- A 1D CA

- - - - -

  • Please log in to reply
No replies to this topic

#1
neshkid123

neshkid123

    Newbie

  • Members
  • PipPip
  • 23 posts
basically the program has the same concept as "Conway's Game of Life". Design and implement the following classes to simulate 1D cellular automata.

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users