Reference no: EM133529967
Analysis, Design and Implementation
Assignment - Cellular Automata
Case Scenario
Cellular Automata (CA) are a family of mathematical models used to explore issues of emergence in formal systems. They are primarily characterised by using a two- dimensional grid of cells, each of which are either in a live or dead state. The grid is then evaluated according to a number of simple rules, and a new arrangement of the grid is generated according to how the rules are applied. The rules are usually very simple, but the patterns they create are often very interesting. Conway's Game of Life is the most famous of these systems, and is defined by the following simple rules:
• A dead cell with three live neighbours becomes a live cell.
• A live cell with two or three neighbours stays a live cell.
• A live cell with more than three or less than two neighbours dies.
Being a neighbour is defined according to what is known as an eight-cell neighbourhood:
Most cellular automata work according to a simple system of:
1. Generate a starting grid
2. Iterate over that grid for a set number of cycles.
a. Evaluate a new grid from old grid
i. Apply each rule in turn to each old cell, filling the new cell with the evaluation from the old cell
b. Copy new grid over old grid
c. Display grid to users
3. Finish execution
This means that one application can serve to work for many different kinds of cellular automata, and your task in this application is to write a program that can permit a user to select between different kinds of CA and set a number of cycles for which they should run. Users should be able to generate a random starting grid from some set parameters as follows:
1. What percentage of cells should be alive
2. How tall should the grid be
3. How wide should the grid be
4. For how many iterations should the CA run
The cellular automata you are required to implement are as follows:
1. Television Static. Cells are alive or dead in a new grid on a 50/50 basis.
2. Game of Life, as discussed above.
3. Seeds, as discussed here
Your application then needs to provide the following functionality:
• Create a parent CellularAutomata class from which the others extend
• Implements the television static cellular automata
• Implements the game of life cellular automata
• Implements the seeds cellular automata
• Creates a random grid of ones and zeros as requested by user.
• Creates a system for evaluating a grid against chosen CA rules
• Make use of polymorphism and encapsulation to have the core application call the appropriate methods in the chosen CA.
Your solution will consist of a class diagram, a use-case diagram, and an activity diagram for the process of generating a new iteration of the Game of Life cellular automata. You should also submit the completed program code in an appropriate programming language.
Task 1 - Candidate class list and Diagrams
Providing an appropriate list of candidate classes, along with the supporting diagrams. The candidate class list should incorporate justifications and discussion as to why each class was selected for inclusion, and how its relationship to other classes was derived. The class diagram should show attributes, operations, scope and relationship of classes to each other.
Please note, you may supplement the attributes listed in the scenario (above) with others that are appropriate. You may wish to discuss this with your lecturer, but credit will still be awarded for reasonable modifications.
Task 2 - Activity diagram
The creation of the appropriate activity diagram. The activity diagram should incorporate the classes involved in performing a complete iteration of a generation. Here, neatness of the flow of logic is important.
The marks for the task are broken down as follows: (1) 20 marks for functionality; and (2) 5 marks for Class ownership.
Task 3 - Use case diagrams
The provision of suitable use-case diagrams. The use case diagram should incorporate each of the user activities indicated in the brief.
Task 4 - Code architecture
A code architecture that shows an appropriate level of coupling and cohesion, along with the necessary amount of inheritance and encapsulation to express the system.
The marks for the task are broke down as follows: (1) 5 marks for handling the requirements via inheritance and polymorphism; (2) 5 marks for handling user input; and
(3) 5 marks for handling output.
Task 5 - System implementations
Implementing the system as described and providing the completed Java code.