Results 1 to 7 of 7
  1. #1
    neshkid123 is offline Member
    Join Date
    Oct 2011
    Posts
    7
    Rep Power
    0

    Default cellular automaton (A 1D CA)

    I need some help and guidance for my next part of the assignment. heres the link to the assignment:
    http://i51.tinypic.com/aenp8h.jpg

    and here is what I have so far, I know its not correct so I would like some comments and suggestions on how to approach this... I am new and am still learning.

    Java Code:
    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()
    }

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,449
    Blog Entries
    7
    Rep Power
    20

    Default Re: cellular automaton (A 1D CA)

    That code doesn't even compile; without knowing any details we don't what to reply ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    neshkid123 is offline Member
    Join Date
    Oct 2011
    Posts
    7
    Rep Power
    0

    Default Re: cellular automaton (A 1D CA)

    theres a link to the assignment of part one, the cell class. Members functions are given, but I need help getting started and how to define these member or if I'm doing it right.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: cellular automaton (A 1D CA)

    You need to check your notes on how to declare variables and methods, how to create classes. If your notes are insufficient, you can always check the Oracle Java tutorials here: Java Tutorials

  5. #5
    neshkid123 is offline Member
    Join Date
    Oct 2011
    Posts
    7
    Rep Power
    0

    Default Re: cellular automaton (A 1D CA)

    I know how to declare variable and create classes.... just need help with the thinking process of how to approach the assignment to make the class. What variable I need and how to define the members.

  6. #6
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,449
    Blog Entries
    7
    Rep Power
    20

    Default Re: cellular automaton (A 1D CA)

    For one thing, I can't even read what is in that jpeg, so I can't help you any further. Feel free to post the details here.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    neshkid123 is offline Member
    Join Date
    Oct 2011
    Posts
    7
    Rep Power
    0

    Default Re: cellular automaton (A 1D CA)

    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

Similar Threads

  1. Cellular Automata Update Problem
    By samanyu in forum New To Java
    Replies: 17
    Last Post: 06-17-2011, 07:21 AM
  2. 1-D Cellular Automata
    By cest.lavie16 in forum New To Java
    Replies: 1
    Last Post: 04-25-2011, 07:40 PM
  3. Some help needed: 2D Cellular Automata
    By markus-sukram in forum AWT / Swing
    Replies: 1
    Last Post: 04-27-2008, 08:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •