GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Suriok/SmartHome-Simulation: Java smart home simulation featuring OOP, design patterns, event management, and resource consumption tracking.

BranchesTags
Open more actions menu

Latest commit

 

History

99 Commits
99 Commits

Folders and files

NameName
Last commit message
Last commit date
gradle/wrapper
gradle/wrapper
 
 
src
src
 
 
.gitignore
.gitignore
 
 
IteratorPattern.png
IteratorPattern.png
 
 
README.md
README.md
 
 
SmartHome.png
SmartHome.png
 
 
Stream.png
Stream.png
 
 
build.gradle.kts
build.gradle.kts
 
 
class_diagraml.xml
class_diagraml.xml
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

SmartHome Simulation

A Java-based console simulation of a smart home system with event-driven interactions, device state management, user activities, and resource consumption tracking.

This project demonstrates object-oriented design, system modeling, and the practical use of multiple design patterns in a larger simulation-based application.

Overview

SmartHome Simulation models a household environment consisting of floors, rooms, users, and smart devices.
The system simulates interactions between users and devices, tracks energy and utility consumption, generates reports, and processes system events.

The project focuses on:

  • object-oriented design
  • system modeling
  • design patterns
  • event-driven architecture
  • state management
  • reporting and consumption tracking

Key Features

  • Smart home structure with floors, rooms, devices, and users
  • Device interaction based on room context
  • User activity simulation
  • Device state transitions
  • Centralized event handling
  • Consumption tracking for electricity, water, and other resources
  • Generated reports for activity, configuration, and usage
  • Use of multiple design patterns in a single system

Architecture

The application is built around a hierarchical object model:

  • House
    • contains multiple Floors
    • each floor contains multiple Rooms
    • rooms contain Devices
    • users move through rooms and interact with available devices

This structure enables contextual device usage and simulation of real household behavior.

Design Patterns Used

The project demonstrates several design patterns:

  • Singleton – centralized system components such as event management
  • Observer – event listeners subscribe to and react to system events
  • State – devices and users change behavior depending on their current state
  • Visitor – reporting logic traverses the smart home structure
  • Iterator – custom iterators simplify traversal of devices and users
  • Factory – device creation is encapsulated in a dedicated factory
  • Builder – smart home configuration is assembled in a structured way

In addition, the project uses Stream API for filtering and aggregation tasks.

Event System

A central event subsystem is responsible for processing and distributing events across the simulation.

Key components include:

  • EventManager – manages subscribers, dispatches events, and stores event history
  • EventPool – reuses event objects to reduce unnecessary allocations
  • EventSource – interface for components that produce events

This makes the simulation more modular and easier to extend.

Reports

The simulation generates reports related to:

  • smart home configuration
  • user activity
  • device usage
  • resource consumption
  • system events

Reporting is one of the core parts of the project and demonstrates traversal and aggregation over the object model.

Diagrams

Main Class Diagram

Smart Home Class Diagram

Iterator Pattern Diagram

Iterator Pattern Diagram

Event / Stream Diagram

Stream class diagram

Tech Stack

  • Java
  • Gradle
  • Log4j2
  • Object-Oriented Programming
  • Java Stream API

Running the Project

Prerequisites

Make sure you have installed:

  • Java 17 or newer
  • Gradle (optional if using the wrapper)

Build the project

./gradlew clean build

Run the simulation

./gradlew run

About

Java smart home simulation featuring OOP, design patterns, event management, and resource consumption tracking.

Topics

console-applicationdesign-patternsevent-drivengradeljavaobserver-patternoopsimulationsimulationssmart-homestate-patternvisitor-pattern

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.