Skip to content
/ desm Public

A Distributed Energy Supply Management system, a simplified simulation of an energy supply network overseen by a renewable energy provider.

Notifications You must be signed in to change notification settings

Luca-02/desm

Repository files navigation

DESM - Distributed Energy System Management

This is a master's degree project that was developed for the Distributed and Pervasive Systems course (A.Y 2024/25).

Project Overview

The DESM (Distributed Energy Supply Management) project simulates a renewable energy supply networkRepository. A renewable energy provider generates power from sources like wind, hydro, and solar. When renewable energy alone can't meet demand, the provider relies on a networkRepository of thermal power plants to cover the shortfall.

These thermal plants compete to fulfill energy requests, with the lowest bidder winning the assignment. An administration server manages the registration/removement of thermal plants and collects environmental data, such as pollutant emissions, from their sensors. This data is periodically sent to the server, which an administration client can query for statistics.

DESM Architecture

System Architecture

For sake of simplicity and ease of development, this project is structured as a Gradle multi-module project, rather than a full-fledged microservices architecture, even though it comprises distinct logical services. The main goal of the project is focused on inter-process communication and application of algorithms for distributed systems.

Renewable Energy Provider

This entity represents the source of energy demand in the system. It initiates energy production requests when renewable sources are insufficient, transmitting this data to the Network Thermal Power Plants through MQTT.

Power Plant Network

This is the core distributed component, a networkRepository of interconnected Thermal Power Plant Peers operating in a ring topology. Each peer is an independent node responsible for:

  • Network Management: Manage the ring structure, maintaining an up-to-date local view of the ring topology.
  • Election Manager: Manage the elections for the incoming energy request that have to be fulfilled using the adapted Chang-Roberts algorithm.
  • Pollution Monitoring: Collecting CO2 emission data and periodically transmitting this data to the Administration Server through MQTT, processed using a sliding window mechanism.

Administration Server

A REST server that dynamically adds/removes power plants to DESM and allows the administration client to see the currently active plants in the networkRepository and to compute statistics about pollution levels.

Administration Client

A client cli that allows querying the administration server to obtain information about the currently active thermal power plants in the networkRepository and their emissions.

Setup and Run

To set up and run the DESM project, follow these steps:

Prerequisites

  • Java Development Kit: Version 17 or higher.
  • MQTT Broker: An MQTT broker (e.g. Mosquitto, HiveMQ Community Edition) must be running and accessible. The system defaults to tcp://localhost:1883.

Getting Started

  1. Clone the Repository: First, clone the project repository to your local machine:

    git clone https://github.com/Luca-02/desm.git
  2. Clean and Build: Navigate to the root directory of the cloned repository and perform a clean build for all subprojects:

    cd desm
    ./gradlew clean build

Running the Components

Ensure your MQTT broker is running before proceeding. You should start the components in the following order: Administration Server, Administration Client, then the Power Plant Peers, and finally, the Renewable Energy Provider.

  1. Administration Server: Navigate to the desm-server directory and run the server application:

    cd .\desm-server\
    ../gradlew run --console=plain
  2. Administration Client: Navigate to the desm-client directory, and run the client application to interact with the Administration Server:

    cd .\desm-client\
    ../gradlew run --console=plain
  3. Power Plant Peers: Open a new terminal windows for each power plant peer you want to run. Navigate to the desm-networkRepository directory and run the application. Each instance will represent a single power plant:

    cd .\desm-networkRepository\
    ../gradlew run --console=plain
  4. Renewable Energy Provider: Navigate to the desm-provider directory and run the renewable energy provider application to generate energy requests:

    cd .\desm-provider\
    ../gradlew run --console=plain

Technologies Used

  • Java: Core programming language for all components.
  • Gradle: For project build automation.
  • Eclipse Paho MQTT Client: For MQTT communication.
  • gRPC: For RPC communication between networkRepository peers.
  • Spring Boot: Framework for developing the Administration Server.
  • RESTful APIs: For client-server communication.
  • Gson: For JSON serialization/deserialization across components.
  • JUnit 5: For unit and integration testing.

About

A Distributed Energy Supply Management system, a simplified simulation of an energy supply network overseen by a renewable energy provider.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages