Results 1 to 7 of 7
Thread: cellular automaton (A 1D CA)
- 10-14-2011, 05:40 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
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() }
- 10-14-2011, 05:54 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,372
- Blog Entries
- 7
- Rep Power
- 17
Re: cellular automaton (A 1D CA)
That code doesn't even compile; without knowing any details we don't what to reply ...
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 10-14-2011, 06:05 PM #3
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
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.
-
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
- 10-14-2011, 07:18 PM #5
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
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.
- 10-14-2011, 07:30 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,372
- Blog Entries
- 7
- Rep Power
- 17
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,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 10-14-2011, 09:02 PM #7
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
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
-
Cellular Automata Update Problem
By samanyu in forum New To JavaReplies: 17Last Post: 06-17-2011, 07:21 AM -
1-D Cellular Automata
By cest.lavie16 in forum New To JavaReplies: 1Last Post: 04-25-2011, 07:40 PM -
Some help needed: 2D Cellular Automata
By markus-sukram in forum AWT / SwingReplies: 1Last Post: 04-27-2008, 08:02 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks