Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Agent-based simulation of a dynamic world in Java, featuring a Swing GUI, customizable rules, and interactive visualization.

Notifications You must be signed in to change notification settings

azhar-fullstack/java-agent-based-simulation

Repository files navigation

Simulation World (Java)

A Java-based agent simulation with a graphical user interface. Demonstrates advanced OOP, agent-based modeling, and GUI development.

๐ŸŒ Project Overview

This project simulates a world populated by agents (e.g., sheep, wolves) that interact on a grid. The simulation features a graphical interface for visualization and user interaction, and supports custom rules and world configurations.

โœจ Features

  • Agent-Based Simulation: Model agents (sheep, wolves, etc.) with behaviors and interactions
  • Grid World: Simulate movement and interaction on a 2D grid
  • Custom Rules: Support for custom rules and world configurations (CSV input)
  • Graphical User Interface: Java Swing-based GUI for visualization and control
  • OOP Design: Modular code with clear separation of backend logic and GUI

๐Ÿ› ๏ธ Technologies Used

  • Java (OOP, Swing)
  • Modular design (multiple packages)
  • CSV file input/output

๐Ÿš€ Getting Started

Prerequisites

  • Java JDK 8 or higher

Build Instructions

Compile all Java files:

javac simulation/backend/*.java simulation/windowInterface/*.java

Run the simulation:

java simulation.windowInterface.Main

๐ŸŽฎ Controls

  • Use the GUI to:
    • Start, pause, or reset the simulation
    • Load custom world or rule files (CSV)
    • Visualize agent movement and interactions
    • Adjust simulation parameters
  • Follow on-screen instructions for additional controls

๐Ÿ“ Project Structure

simulation-world-java/
โ”œโ”€โ”€ simulation/
โ”‚ โ”œโ”€โ”€ backend/ # Simulation logic (Agent, Grid, World, etc.)
โ”‚ โ””โ”€โ”€ windowInterface/ # GUI (Swing interface)
โ”œโ”€โ”€ BlobRule.csv # Example rule file
โ”œโ”€โ”€ glider.csv # Example world file
โ”œโ”€โ”€ Main.class # Compiled entry point
โ”œโ”€โ”€ README.md # This file

๐Ÿง‘โ€๐Ÿ’ป Skills Demonstrated

  • Java OOP (classes, encapsulation, packages)
  • Agent-based modeling
  • GUI development (Swing)
  • Simulation and modeling
  • Modular code organization

๐Ÿ“„ License

This project is open source and available under the MIT License.


Author: Azhar Mehmood Language: Java Category: Simulation, Agent-Based Modeling, GUI Development

About

Agent-based simulation of a dynamic world in Java, featuring a Swing GUI, customizable rules, and interactive visualization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle ใซใ‚ˆใฃใฆๅค‰ๆ›ใ•ใ‚ŒใŸใƒšใƒผใ‚ธ (->ใ‚ชใƒชใ‚ธใƒŠใƒซ) /