GithubHelp home page GithubHelp logo

cs307-cellsociety's Introduction

Cell Society

This project implements a cellular automata simulator.

Names: Jeremy Cross Tarun Amasa Evan Kenyon Keith Cressman

Timeline

Start Date: October 13

Finish Date: November 1

Hours Spent: 175

Primary Roles

Remy- Backend: Logic for Rules class, cell shapes Tarun- Backend: Model, CSV parser, Cell Keith- FrontEnd Evan- Sim parser and generator, controller

Resources Used

https://medium.com/@mglover/java-fx-testing-with-testfx-c3858b571320 https://www.w3schools.com/java/java_lambda.asp https://www.callicoder.com/javafx-css-tutorial/ http://tutorials.jenkov.com/javafx/imageview.html https://www.redblobgames.com/grids/hexagons/

Running the Program

Main class: Main

Data files needed:

  • KeyAlternatives.properties
  • NumCorners.properties
  • ValuesAlternatives.properties
  • CSSids.properties
  • DisplayProperties.properties
  • EdgePolicies.properties
  • NeighborArrangements.properties
  • ShapeCornerGenerator.properties
  • StateColor.properties
  • GameOfLifeRules.properties
  • PercolationRules.properties
  • PredatorPrey.properties.properties
  • PredatorPreyDefaultParams.properties
  • SegregationDefaultParams.properties
  • SpreadingOfFireDefaultParams.properties
  • SpreadingOfFireRules.properties

Features implemented:

  • All games implemented
    • GameOfLife
    • SpreadingOfFire
    • Segregation
    • Percolation
    • PredatorPrey
  • Neighbor Arrangements
    • Cardinal
    • Complete
    • Strictly one corner
  • Edge Policies
    • Finite
    • Toroidal
    • Mirror
  • Grid Location Shapes
    • Square
    • Triangle
    • Hexagon
  • Views
    • Grid of Cells
    • Histogram
    • Info Display
  • Simulation Values
    • Grid Properties
  • Initial Configuration
    • Cell States for grid location
    • Probabilities
    • Raw Number Configuration
  • Style
    • Grid Properties
    • Language
    • Color Style

Notes/Assumptions

Assumptions or Simplifications:

  • In cellsociety.view.CellGridDisplay, I assume that the argument newShape is a String corresponding to a valid shape, i.e. "Rectangle", "Triangle", or "Hexagon". Currently in our code, those are the only possibilities, but if the code was extended for other purposes, people could misuse this method
  • Assumes that cells are going to be colored, not using images

How potential errors are handled:

  • required value not given

Propagated from SimParser to frontend, frontend displays an error message that is contained in a properties file.

  • invalid value given (like a non-existent simulation, edge policy, neighborhood arrangement, or negative percentage)

Propagated from SimParser to frontend, frontend displays an error message that is contained in a properties file.

  • invalid cell state values given

Propagated from CSVParser to frontend, frontend displays an error message that is contained in a properties file.

  • cell locations given that are outside the bounds of the grid's size

Propagated from CSVParser to frontend, frontend displays an error message that is contained in a properties file.

  • empty, badly formatted, or non-CSV files given

Propagated from CSVParser to frontend, frontend displays an error message that is contained in a properties file.

Added Key Names for Config Files (all of these are optional):

  • EdgePolicy (can equal Toroidal, Finite, or Mirror)
    • Default is Finite
  • Shape (can equal Triangle, Hexagon, or Rectangle)
    • Default is Rectangle
  • NeighborArrangement (can equal Corner, Cardinal, Edge)
    • Default is Edge
  • CSVType (can equal Probability, RawNums, or Default)
    • Default is Default

CSV Type Formats:

  • Probability is of the format cols,rows,probabilityStateOne,probabilityStateTwo
    • probabilityStateZero = 1 - probabilityStateOne - probabilityStateTwo
  • RawNums is of the format cols,rows,numStateOne,numStateTwo
    • numStateZero = cols*rows - numStateOne - numStateTwo

Interesting data files:

  • fire/bad.csv
  • fire/basic.csv
  • fire/probabilityAllTwo.sim (/csv)
  • fire/rawNumsHalfandHalf.sim (/csv)
  • game_of_life/invalidDimension.sim (/csv)
  • game_of_life/rawNumsHalfAndHalf.sim (/csv)
  • game_of_life/probabilityAll.sim (/csv)

Known Bugs:

  • In segregation, some of the cells spontaneously disappear
  • If the grid is made into a rectangle instead of a square, there are issues with triangle and hexagon cell shape
  • Can't dynamically set edge policy from frontend

Noteworthy Features: The games work for the most part besides a couple of glitches. The view has some nice features like changing the color of the window, the shape of the cell, and the animation speed. It also has a histogram of cell states and an info display.

Impressions

The logical aspects of this project were actually enjoyable to program. We used a lot of the skills that we learned in class to improve the design of our code like lambdas and reflection in the rules classes. For many of the rules, rather than having many if statements, the reflections helped simplify our logic.

cs307-cellsociety's People

Contributors

keithcressman avatar ek168 avatar tarunamasa avatar remycross1019 avatar robertcduvall avatar evankenyon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.