Skip to content

rswernofsky/updated-cellular-automata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Updated Cellular Automata

Now that I've taken a more advanced course on Object-Oriented Design, I wanted to see how I would design my original solution differently to Problem 1 from this assignment from a previous course I took.

It models simple binary rule-based cellular automata, arranged in a line. The program starts with a single row of square cells whose states are either on or off. On every tick, a new row of children cells are generated from the previous row using a specified rule. Certain rules cause interesting patterns to emerge.

Design changes

  • uses JUnit instead of tester.jar (testing library built by my professor)
  • uses Swing instead of javalib.jar (image library built by my professor)
  • is now compartmentalized using MVC architecture
    • drawing uses the adapter pattern
    • a combination of a main class and a Controller do the job of the CAWorld
  • no longer having separate objects for Cells with different rules: Rule30Cell, InertCell, etc objects don't take advantage of dynamic dispatch, which is one of the main advantages of representing types as objects. So for the sake of simplicity, I just let a cell's "rule" be a variable

Notes for running

This program uses the arguments that the main method receives as input (String[] args). Set up a run configuration that just contains the rule (a number) (in IntelliJ this is the box labeled "program arguments"). a screenshot of my run configurations

Interesting rules to use: 30, 54, 60, 182. Here's rule 182 in action: a screenshot of rule 182 in action

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages