From b8d379ff7db34714c1ff96c06bcace61194bfd54 Mon Sep 17 00:00:00 2001 From: maxim Date: Fri, 24 May 2024 14:46:52 +0200 Subject: [PATCH] final push ReadMe --- Readme .txt | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 Readme .txt diff --git a/Readme .txt b/Readme .txt new file mode 100644 index 0000000..6a8e9b5 --- /dev/null +++ b/Readme .txt @@ -0,0 +1,79 @@ +READ ME : + +About the Game of life : + + +The Game of Life has been created by the mathematician John Conway. It is a game that plays by itself using a grid of cells. Each cell can be either alive or dead. The game evolves step. Each state of each cell determines the following state of the cells around it through a set of simple rules. + + +Game Setup: + +1. Import Project onto Eclipse + +2. Run the Application + + a. In the 'Project Explorer', locate the 'Main' class ('src/main/java/Main.java') + + b. Right click on the 'Main' class + + c. Select 'Run As > Java Application'. + + + +Usage: + +- Start/Pause Simulation: Click the "Start/Pause" button to start or pause the simulation. + +- Toggle Click Action: Click the "Toggle Click" button to switch between different click actions. + +- Load/Save World: Use "Load World" and "Save World" buttons to load or save the simulation state. + +- Load/Save Rules: Use "Load Rule" and "Save Rule" buttons to load or save the simulation rules. + +- Load/Save Agents: Use "Load Agents" and "Save Agents" buttons to load or save the agents. + +- Random Field Generation: Adjust the density slider and click "Random Field" to generate a random grid. + +- Toggle Border: Click "Toggle Border" to switch between looping and closed borders. + +- Adjust Speed: Use the speed slider to adjust the simulation speed. + + + +About the project : + +The given project includes a main class, other various classes, and a graphical interface. Our task was to implement numerous methods required for the buttons in the GUI to function. All new Java files were created in the backend package. The Main class in the interface package will not be modified but is essential to run the game. After each modification, if there was no error we would push the files through Gitarero. + + +About the Simulator class : + +The central class of the project is the Simulator. It is dealing with the position and evolution of cells on the grid. We have also implemented methods to control simulation parameters like looping borders, pause, delay, and cell states that can be used on the graphical interface. Some other modifications involes to write methods for toggling borders, pausing, controlling the simulation speed, setting the grid dimensions and cell states but also handling cell clicks, generating random worlds, and saving/loading world states, rules, and agents. + + +About the Grid and Cell classes : + +These two additional classes were created from sractch and work together to represent the grid world and manage the state and behavior of individual cells within it. The Grid class provides a structure for organizing cells, while the Cell class defines the behavior of each individual cell according to the rules of the Game of Life. + + +Other Classes: + +- Agent Class: Abstract class respresents an agent with basic properties + +- Sheep Class: Concrete implementation of the Agent class representing a sheep with specific behaviors + +- JPanelDraw: Extends Jpanel to draw the simulation grid and agents. It essentially takes care of the mouse clicks to allow interactions. + +- MyInterface: Extends JFrame to create the main window with controls for the simulation + + +Rules: + +- Underpopulation: A live cell with fewer than two live neighbors dies, as if by underpopulation. + +- Survival: A live cell with two or three live neighbors lives on to the next generation. + +- Overpopulation: A live cell with more than three live neighbors dies, as if by overpopulation. + +- Reproduction: A dead cell with exactly three live neighbors becomes a live cell, as if by reproduction. + +