Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,100 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- reinforcement-learning
|
| 5 |
+
- multi-agent
|
| 6 |
+
- time-series
|
| 7 |
+
- diffusion-model
|
| 8 |
+
- energy-management
|
| 9 |
+
- smart-grid
|
| 10 |
---
|
| 11 |
+
# SolarSys: Scalable Hierarchical Coordination for Distributed Solar Energy
|
| 12 |
+
|
| 13 |
+
SolarSys is a novel **Hierarchical Multi-Agent Reinforcement Learning (HRL)** system designed to manage energy storage and peer-to-peer (P2P) trading across large communities of solar-equipped residences. This repository contains the full source code for the SolarSys system, including the trained policies, the custom Gym environment, and the hierarchical diffusion model used for data generation.
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
## System Architecture
|
| 19 |
+
|
| 20 |
+
The core of SolarSys is a two-level decision hierarchy:
|
| 21 |
+
|
| 22 |
+
1. **Low-Level (Intra-Cluster):** Individual households use a **MAPPO** agent to make instantaneous decisions (charge, discharge, local P2P trade, grid trade) based on local meter readings and price signals.
|
| 23 |
+
2. **High-Level (Inter-Cluster):** Cluster Managers use a **Mean-Field** policy to coordinate bulk energy transfers between clusters, ensuring the overall system remains balanced against grid constraints.
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## Data Generation Framework
|
| 31 |
+
|
| 32 |
+
To enable large-scale simulation with realistic temporal dynamics, SolarSys includes a **Hierarchical Diffusion Model** for generating synthetic, long-duration energy profiles that maintain both long-term (seasonal/monthly) and short-term (daily/hourly) characteristics.
|
| 33 |
+
|
| 34 |
+
* **Model:** Hierarchical Diffusion U-Net
|
| 35 |
+
* **Input:** Location based housing dataset(eg. Ausgrid dataset, newyork dataset)
|
| 36 |
+
* **Output:** High-resolution time series for Grid Usage and Solar Generation (kWh).
|
| 37 |
+

|
| 38 |
+
|
| 39 |
+
To ensure all necessary libraries are available, install dependencies using the provided `requirements.txt` file:
|
| 40 |
+
|
| 41 |
+
```bash
|
| 42 |
+
pip install -r requirements.txt
|
| 43 |
+
---
|
| 44 |
+
## Repository Structure
|
| 45 |
+
The project is organized into core modules and data folders.
|
| 46 |
+
```tree
|
| 47 |
+
SolarSys_Hugging_face/
|
| 48 |
+
βββ assets/
|
| 49 |
+
βββ requirements.txt # Project Dependencies
|
| 50 |
+
βββ Dataset/ # Energy Data (Raw, Processed, and Synthetic)
|
| 51 |
+
β βββ Data/
|
| 52 |
+
β β βββ Ausgrid_processed_data.zip # Processed data (Australia)
|
| 53 |
+
β β βββ Ausgrid_raw_data/
|
| 54 |
+
β β βββ Pecan_street_processed_data.zip # Processed data (US)
|
| 55 |
+
β βββ Generated_Data.zip # Example synthetic data (2000 agents)
|
| 56 |
+
βββ Data_generation_tool_kit/ # Hierarchical Diffusion Model Code
|
| 57 |
+
β βββ Hier_diffusion_energy/
|
| 58 |
+
β β βββ hierarchial_diffusion_model.py # H-Diffusion U-Net Architecture
|
| 59 |
+
β β βββ global_scaler.gz # Global normalization scaler, please delete and rerun if had problem
|
| 60 |
+
β βββ dataloader.py #
|
| 61 |
+
β βββ train.py # Diffusion model training script
|
| 62 |
+
β βββ generate.py # Script to generate long-term sequences
|
| 63 |
+
βββ Models/ # Trained RL Policies for trial, please retrain your model for best results
|
| 64 |
+
β βββ 100agents_10size/
|
| 65 |
+
β β βββ models/
|
| 66 |
+
β β βββ inter_ep10000.pth # High-Level (Inter-Cluster) policy
|
| 67 |
+
β β βββ low_clusterX_ep10000.pth # Low-Level (Intra-Cluster) policies
|
| 68 |
+
β βββ (Additional scaling folders) # e.g., 5agents_5size/, 1000agents_20size/, etc.
|
| 69 |
+
βββ SolarSys/ # SolarSys Implementation (MAPPO + MeanField)
|
| 70 |
+
β βββ Environment/
|
| 71 |
+
β β βββ cluster_env_wrapper.py # Vectorized environment wrapper
|
| 72 |
+
β β βββ solar_sys_environment.py # Core Gym environment definition
|
| 73 |
+
β βββ mappo/ # MAPPO policy definition (Intra-Cluster)
|
| 74 |
+
β β βββ trainer/
|
| 75 |
+
β β βββ mappo.py # MAPPO algorithm
|
| 76 |
+
β βββ meanfield/ # MeanField policy definition (Inter-Cluster)
|
| 77 |
+
β β βββ trainer/
|
| 78 |
+
β β βββ meanfield.py # MeanField algorithm core
|
| 79 |
+
β βββ cluster.py # Inter-Cluster Coordinator logic
|
| 80 |
+
β βββ training_freezing.py # Main SolarSys HRL training script
|
| 81 |
+
β βββ cluster_evaluation.py # Evaluation script for SolarSys
|
| 82 |
+
βββ Other_algorithms/ # Baselines
|
| 83 |
+
βββ HC_MAPPO/ # Hierarchical Cluster MAPPO
|
| 84 |
+
β βββ Environment/
|
| 85 |
+
β βββ HC_MAPPO_train.py # Training script for HC-MAPPO
|
| 86 |
+
β βββ HC_MAPPO_evaluation.py # Evaluation script for HC-MAPPO
|
| 87 |
+
βββ Flat_System/ # Flat Baselines
|
| 88 |
+
βββ maddpg/ # Multi-Agent DDPG
|
| 89 |
+
β βββ maddpg_train.py
|
| 90 |
+
β βββ maddpg_evaluation.py
|
| 91 |
+
βββ mappo/ # Flat MAPPO
|
| 92 |
+
β βββ mappo_train.py
|
| 93 |
+
β βββ mappo_evaluation.py
|
| 94 |
+
βββ meanfield/ # Flat MeanField Actor-Critic (MFAC)
|
| 95 |
+
β βββ meanfield_train.py
|
| 96 |
+
β βββ meanfield_evaluation.py
|
| 97 |
+
βββ PG/ # Policy Gradient (PG)
|
| 98 |
+
β βββ pg_train.py
|
| 99 |
+
β βββ pg_evaluation.py
|
| 100 |
+
βββ solar_sys_environment.py # Copy of the flat environment for baselines
|