OOP_F5_Project/Readme.md

2.4 KiB

Experimental Game of Life Simulator

Overview

This project explores various extensions of Conway's Game of Life, including custom rules, agent interactions, and mixed populations. The focus is on creating interesting patterns and behaviors through an interactive GUI.

Features

  • Standard and Custom Game of Life Rules: Supports Conway's original rules and custom rule sets.
  • Mixed Populations: Includes Sheep and Wolf agents with specific behaviors and interactions.
  • Interactive GUI: Allows users to start, pause, stop the simulation, and edit the world state in real-time.
  • Speed Control: Adjust the simulation speed with a slider.
  • Border Toggle: Switch between looping and closed borders.
  • Random Initialization: Fill the world with a random state using a probability slider.
  • File Operations: Save and load world states, agents, and rules from files.

Getting Started

GUI Instructions

Buttons

  • Start/Pause: Starts or pauses the simulation. If the world is not loaded, a default world is created.
  • Stop: Stops the simulation and resets the world to its default state.
  • Toggle Border: Switches between looping and closed borders.
  • Random: Fills the world with randomly living or dead cells based on the probability set by the slider.
  • Save File: Saves the current world state, agents, and rules to a file.
  • Load File: Loads a world state, agents, and rules from a file.

Interacting with the World

  • Click on cells to toggle their state. This allows for creating or editing the starting state of the world.

File Format

World State

  • Each line represents a row in the grid.
  • Cells in a row are separated by semicolons (;).

Example:

0;0;1;0;0
0;1;1;1;0
0;0;1;0;0
0;0;0;0;0
0;0;0;0;0

Agents and Rules

  • Agents: Coordinates and types of agents are saved in a structured format.
  • Rules: Custom rules are saved as lists of birth and survival conditions.

Extending the Project

Custom Rules

  • Modify the rules to implement different variations of the Game of Life.
  • Examples: HighLife, aging cells, predator-prey models.

Agents

  • Implement additional agent types and behaviors.
  • Example: A Wolf that hunts Sheep and reproduces.

Example Patterns

  • Glider: A small pattern that moves across the grid.
  • R-Pentomino: A pattern that evolves in complex ways.
  • Gosper Glider Gun: A pattern that produces a stream of gliders