Skip to content

A simulation platform that would allow developers to easily add a variation of the cellular automata simulation and implemented seven simulations

License

Notifications You must be signed in to change notification settings

sweetkimchi/cellularautomata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,138 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cell Society

INTRO VIDEO: Introduction Video

This project implements a cellular automata simulator.

Names: Ji Yun Hyo - jh160
Shaw Phillips - sp422
Harrison Huang - hlh38

Timeline

Start Date: February 6th

Finish Date: February 21st

Hours Spent: Jiyun - 80 hours (weeks 1 + 2)
Harrison - 40 hours (weeks 1 + 2) Shaw - 30 hours (weeks 1 + 2)

Primary Roles

Shaw: I created the Decoder class along with the XMLParser and XMLException classes, which dealt with prompting the user to select a file, parsing it, and passing the appropriate parameters to the Simulation Engine in order to setup the simulation. I added the XML template files and setup the ability to save the simulation's configuration. I also implemented error checking and exception handling for the XML files through the use of JavaFX alerts.

Jiyun: I designed the overall structure of the project using StarUML. Facilitated better work communication by integrating Gitlab to Slack (all members get notified with Gitlab notifications in real-time through Slack). Was in charge of 1) Main.java, simulationengine package, grid package (3 parts of Controller component) and 2) entirety of Models. I also wrote the templates and its descriptions, formatted the files according to Google format, and helped refactor parts of the classes for better design. I also followed up with team members to facilitate communication and to make sure we have implemented everything specified by the spec. Spent time refactoring. Implemented classes: Main, model package

Harrison: I created the view component of the project, of which the main three components are the SimulationScreen, GridGraphics, and SidePanel. I also had to provide functionality of the controls put in SidePanel by coordinating with the SimulationEngine. I implemented the resource property file and CSS file for the front end in order to have more flexibility in the display. I had to manage the view and state of the grid, as well as allow for resizing. This was extended in the complete version with the addition of an independent Graph view, multiple simultaneous simulations, additional language support, and color palette functionality, among other things.

Resources Used

  1. Shaw
  2. Harrison Huang
  3. Ji Yun Hyo

Running the Program

Main class: Main.java

Data files needed: All necessary XML files are under "data" folder

Features implemented: WaTor Simulation, Percolation, Spreading of Fire, Game of Life, Segregation; 6 templates for each; simulation screen with functional start/stop/reset buttons, speed slider, ability to load new XML files, dynamically updating and sized grid, independent grid and graph views, multiple simultaneous simulations, simulation appearance selection in colors and language, ForagingAnt, Rock scissor paper, different number of neighbors (3, 4, 6, 8, 12).

Notes/Assumptions

Assumptions or Simplifications: The assumption in the beginning was that we would need a bunch of classes for each model. However, along the way, I realized that all the models did not really need to have a lot of the same classes. For example, I ended up getting rid of the Cell classes for all the rules because it was evident that State and Cell performed the same thing. Also, because I came up with the Rule abstract class, we did not need to have a separate builder for each one. GridManager was able to take in all the parameters for all models and produce the starting states and update the cell states successfully. Therefore, the design became much "simpler" and more efficient than what we had initially imagined. As of the basic implementation, all three components (MVC) are working together by informing each other of its states but do not specifically have to know the inner-workings of each class in order to cooperate. One area that should be a focus for potential future improvement is removing the cyclic dependency between the controller and view, between SimulationEngine and SimulationScreen.

Interesting data files: (Jiyun) I manually tested out the templates and have selected the ones that produce interesting results. I think all the templates are worth your time to checkout. I tried to " model" real life situations with the models.

Known Bugs:

  • The grid resizing only works when the simulation is running, so when the simulation is stopped, the grid will not resize if the window size is changed.
  • When Load New is pressed but no file is selected, the program will throw a NullPointerException, though this does not affect the overall program functionality. The descriptions can also disappear too soon if a new file is not selected. The Load New button can be pressed multiple times before actually triggering, which can result in weird behavior.
  • The graph window doesn't plot the initial states when it is first created, though it updates correctly.
  • Changing the stylesheet/CSS file will result in a strange warning in the console, though this does not ultimately impact the overall functionality.

Extra credit: None

Impressions

Jiyun: Personally, I really liked working on this project. I liked how Cellular Automata could be used to simulate real-life situations. I also liked witnessing how a good design could help out immensely throughout the project. I also appreciate everyone putting in the effort.

Harrison: I think it was really cool that we were all able to put together a working project all while trusting each other to do our own part. While largely independent of the Model, I could focus more on implementing features for the view and improving the UI.

About

A simulation platform that would allow developers to easily add a variation of the cellular automata simulation and implemented seven simulations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •