Skip to content

DRJ-14/Smart-Garden-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Garden Simulation System (OOAD-based)

Java OOP OOAD Simulation

A Smart Garden Simulation System designed using Object-Oriented Analysis & Design (OOAD) principles to model, monitor, and control garden components such as plants, sensors, irrigation, and environmental conditions through a modular and extensible architecture.


🚀 Quickstart (30 seconds)

  1. Open the project in IntelliJ IDEA / Eclipse
  2. Run the Main Simulation Controller
  3. Configure garden parameters (plants, sensors, watering rules)
  4. Observe real-time garden behavior simulation

✨ Key Features

  • Object-oriented modeling of garden entities (plants, sensors, irrigation controllers)
  • Rule-based irrigation logic driven by environmental conditions
  • Modular and extensible system architecture
  • Clear separation of responsibilities using OOAD principles
  • Simulation-driven execution without physical hardware dependency

🧠 Architecture Overview

High-Level Diagram

User / Simulation Controller
            |
            v
     Garden Manager
            |
   -------------------
   |        |        |
 Plant   Sensor   Irrigation
 Models  System    Controller
   |        |        |
 Environment State & Rules Engine

Garden Manager

  • Acts as the central coordinator of the system
  • Manages lifecycle of plants, sensors, and irrigation components
  • Applies business rules and advances simulation steps

Sensor System

  • Simulates environmental sensors (soil moisture, temperature, humidity)
  • Feeds real-time environmental data into the system
  • Designed for easy extension with new sensor types

Irrigation Controller

  • Decides watering actions based on sensor readings
  • Implements strategy-based decision logic
  • Prevents overwatering and optimizes resource usage

Plant Models

  • Encapsulate plant-specific attributes and behavior
  • React dynamically to environmental conditions
  • Follow strict encapsulation and abstraction principles

🧠 Design Patterns Used

Pattern Where Used Purpose
Singleton Garden Manager Ensures a single coordination point for the simulation
Strategy Irrigation Controller Enables flexible watering decision algorithms
Observer Sensor System → Controllers Propagates environmental updates reactively
Factory Plant / Sensor creation Decouples object creation from business logic

🧩 OOAD & SOLID Principles Applied

  • SRP – Each class has a single, well-defined responsibility
  • OCP – New plant or sensor types can be added without modifying existing logic
  • DIP – Controllers depend on abstractions, not concrete implementations
  • Clear separation between domain models, control logic, and simulation flow

📌 Future Enhancements

  • GUI dashboard using JavaFX or web frontend
  • Integration with real IoT sensors
  • Persistence layer for historical data
  • Automated testing for simulation scenarios

About

Java-based Smart Garden simulation modeling plant growth, parasite/pest attacks, and environmental events using OOP, multithreading, event-driven design, and JSON-configured entities (plants.json, parasites.json).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages