Interactive

2D Cellular Automata

in 3D

Nadia Karlinsky

 
Cellular Automata: an Introduction

code (detailed comments within code describe the program):

  • main.cpp
  • timestep.h
  • timestep.cpp
  • cell.h
  • cell.cpp

    Download the executable

    Download the MS Visual C++ 6.0 workspace

    Information on obtaining and installing GLUT

  •  
    Purpose of the Program  
    Interactive 2D Cellular Automata in 3D is an interactive, 3-dimensional introduction to cellular automata (CA). Currently, the program allows the user to evolve a 100-cell CA grid step-by-step, choosing among one of two CA rules and one of three initial configurations of on/off cells. See "Future Development," below, for a more detailed explanation of the intent of the program.
     
    Using the Program  
    Run the executable. Right-click anywhere on the screen and choose a rule from the pop-up menu. Pick an initial configuration by right-clicking again and choosing "start over (new initial config)." You can choose this option again to choose a different initial configuration. To evolve the CA right-click again and choose "next step" repeatedly (alternatively, simply hit "n") . To exit, right-click and choose "exit" or hit the escape key. You can start over mid-evolution by choosing "start over (new in itial config)" or "start over (same initial config)." Note: as I have coded a default rule and a default initial configuration, you can simply hit "n" as soon as the program starts to watch an evolution.
     
    Future Development  
    The exploration of the evolution of a 2-dimensional CA that I have coded is only a framework for what I envisioned.
  • More initial configurations should be hard-coded. In addition, the user should be able to choose an initial configuration.
  • More rules should be hard-coded, and the user should be able to specify a rule. Note: currently, the rules are limited not only in number but in type. Both rules are of the "life" family, which are defined in S/B notation, where S is the number of a live neighbors necessary for a cell to survive and B is the number of alive neighbors necessary for a cell to be born. It would be trivial to implement a user-chosen "life"-type rule, as I have already developed the algorithm for such rules -- all that re mains is to let the user specify the S and B in the rule notation and feed those numbers to the algorithm. A larger variety of rules should be implemented. A listing of rule families can be found h ere.
  • Movement should be implemented (currently, the grid is slightly rotated in anticipation of future implementation of dynamic and user-directed rotation). The following describes the use of movement in an interactive evolution of a 3-dimensional repr esentation of a 2-dimensional cellular automata:
      The screen shows a grid with some initial configuration. The grid rotates so the user sees that it is actually a 3-dimensional layer consisting of blocks (cells). The layer moves farther into the screen. An identical grid appears on the screen, in the same position as the initial position of the previous grid. Numbers appearing on the blocks indicate the number of alive cells surrounding the particular cells each number is on. This layer then changes to reflect the new configur ation according to a previously chosen rule. This layer then moves away to settle on top of the previous layer. After this is repeated several times the whole structure is brought forward, which can then be manipulated by the user: rotation, zooming in/ out, inspection of particular layers, etc.
  • numSteps is initialized to 50, so there is a maximum number of 50 steps. More steps should be implemented.
  • Text should be added to the program, perhaps in another window, describing the process of the evolutions, providing the user with directions, etc.
  • The grid should be made much larger. Right now, the number of interesting configurations is limited by the small size of the grid.
  • What happens when a particular configuration runs off the grid? There are various ways to get around this, including "wrapping" the field. Currently, I handle this problem by simply restricting the cells that I consider and allowing only those rule/ initial configurations that would evolve accurately (well, they *did* evolve accurately until I coded in extra initial configurations and rules beyond the default ones). If a particular rule and configuration state that a cell should be born whose positi on is outside my 10-by-10 grid, that cell is simply ignored -- which means that subsequent evolutions won't be correct, as that cell won't be taken into account. A solution to this needs to be coded. Note: currently, I have a "buffer" of dead cells arou nd the 10-by-10 grid (so that it is actually a 12-by-12 grid, with the outer rows and columns invisible) -- this buffer is used in the count of alive neighboring cells for the cells that are on the edges of the 10-by-10 grid.
  • For this to truly be a full-fledged CA program, 1-dimensional and 3-dimensional CA interactivity should be added.
  • What would be really cool is if this could be coded for the CAVE -- it would be really interesting to be able to manipulate this stuff in 3D.
  • To really get a feel for CA and the various rules, I found it helpful to try to come up with an initial configuration reflecting some later configuration I had in mind. It would be interesting to see this actually implemented. Perhaps the user woul d be given a rule and some configuration; he then would have to play around with the initial configuration, aided by a series of grids on the screen showing him the next few evolutions.
  •  
    Some Thoughts on Long-term Projects
    and Information-gathering
     
    Don't depend on finding all the information to carry you through a project according to your original plans, especially as time is ticking away. Be flexible -- don't lose momentum because of a too-rigid project structure. Even if you have not yet compil ed all the information on your wishlist, start testing out different ideas and different approaches. Laying down a framework is more important than (and perhaps necessary before) completing the research.