File size: 2,953 Bytes
152656a
 
4611ffd
 
 
 
 
 
 
152656a
c8f7f49
152656a
4611ffd
152656a
4611ffd
1b98bf0
4611ffd
 
 
c8f7f49
4611ffd
 
 
 
 
 
 
 
 
 
c8f7f49
4611ffd
 
 
 
 
 
 
 
 
 
 
c8f7f49
4611ffd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1b98bf0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
license: mit
tags:
- reinforcement-learning
- multi-agent
- time-series
- diffusion-model
- energy-management
- smart-grid
---
# SolarSys: Scalable Hierarchical Coordination for Distributed Solar Energy

[Source: The SolarSys paper (e.g., your PDF) is the primary source for all claims below.]

[cite_start]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[cite: 10]. 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 augmentation.

---


## System Architecture

The core of SolarSys is a two-level decision hierarchy:

1.  [cite_start]**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[cite: 13, 313].
2.  [cite_start]**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[cite: 14, 314].



---

##  Data Generation Framework

[cite_start]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[cite: 254, 255].

* [cite_start]**Model:** Hierarchical Diffusion U-Net [cite: 254, 255]
* [cite_start]**Input:** Household ID and Day-of-Year conditioning [cite: 256]
* **Output:** High-resolution time series for Grid Usage and Solar Generation (kWh).



---

## Repository Structure

The project is organized into core modules and data folders.

```tree
SolarSys/
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ per_house/              # Raw CSVs for diffusion model training
β”‚   β”œβ”€β”€ training/               # Cleaned RL training datasets
β”‚   └── testing/                # Cleaned RL evaluation datasets
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ diffusion_models/       # Trained Hierarchical Diffusion Model checkpoints
β”‚   β”œβ”€β”€ mappo_models/           # Trained MAPPO baselines and low-level agents
β”‚   └── inter_agent_models/     # Trained MeanField high-level coordinator
β”œβ”€β”€ Environment/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── solar_sys_environment.py # Custom Gym environment for flat RL
β”œβ”€β”€ cluster/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── inter_cluster_coordinator.py # Logic for high-level trade matching
└── trainers/
    β”œβ”€β”€ __init__.py
    β”œβ”€β”€ hierarchical_train.py   # Main SolarSys HRL training script
    └── evaluation_scripts/     # Scripts for baselines (PG, MADDPG, MAPPO, MFAC)