Update README.md
Browse files1234---license: mit---Models and code comming soon!123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100---license: mittags:- reinforcement-learning- multi-agent- time-series- diffusion-model- energy-management- smart-grid---# SolarSys: Scalable Hierarchical Coordination for Distributed Solar EnergySolarSys 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.---## System ArchitectureThe core of SolarSys is a two-level decision hierarchy: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.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.---## Data Generation FrameworkTo 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.* **Model:** Hierarchical Diffusion U-Net* **Input:** Location based housing dataset(eg. Ausgrid dataset, newyork dataset)* **Output:** High-resolution time series for Grid Usage and Solar Generation (kWh).To ensure all necessary libraries are available, install dependencies using the provided `requirements.txt` file:```bashpip install -r requirements.txt---## Repository StructureThe project is organized into core modules and data folders.```treeSolarSys_Hugging_face/βββ assets/βββ requirements.txt # Project Dependenciesβββ Dataset/ # Energy Data (Raw, Processed, and Synthetic)β βββ Data/β β βββ Ausgrid_processed_data.zip # Processed data (Australia)β β βββ Ausgrid_raw_data/β β βββ Pecan_street_processed_data.zip # Processed data (US)β βββ Generated_Data.zip # Example synthetic data (2000 agents)βββ Data_generation_tool_kit/ # Hierarchical Diffusion Model Codeβ βββ Hier_diffusion_energy/β β βββ hierarchial_diffusion_model.py # H-Diffusion U-Net Architectureβ β βββ global_scaler.gz # Global normalization scaler, please delete and rerun if had problemβ βββ dataloader.py #β βββ train.py # Diffusion model training scriptβ βββ generate.py # Script to generate long-term sequencesβββ Models/ # Trained RL Policies for trial, please retrain your model for best resultsβ βββ 100agents_10size/β β βββ models/β β βββ inter_ep10000.pth # High-Level (Inter-Cluster) policyβ β βββ low_clusterX_ep10000.pth # Low-Level (Intra-Cluster) policiesβ βββ (Additional scaling folders) # e.g., 5agents_5size/, 1000agents_20size/, etc.βββ SolarSys/ # SolarSys Implementation (MAPPO + MeanField)β βββ Environment/β β βββ cluster_env_wrapper.py # Vectorized environment wrapperβ β βββ solar_sys_environment.py # Core Gym environment definitionβ βββ mappo/ # MAPPO policy definition (Intra-Cluster)β β βββ trainer/β β βββ mappo.py # MAPPO algorithmβ βββ meanfield/ # MeanField policy definition (Inter-Cluster)β β βββ trainer/β β βββ meanfield.py # MeanField algorithm coreβ βββ cluster.py # Inter-Cluster Coordinator logicβ βββ training_freezing.py # Main SolarSys HRL training scriptβ βββ cluster_evaluation.py # Evaluation script for SolarSysβββ Other_algorithms/ # Baselinesβββ HC_MAPPO/ # Hierarchical Cluster MAPPOβ βββ Environment/β βββ HC_MAPPO_train.py # Training script for HC-MAPPOβ βββ HC_MAPPO_evaluation.py # Evaluation script for HC-MAPPOβββ Flat_System/ # Flat Baselinesβββ maddpg/ # Multi-Agent DDPGβ βββ maddpg_train.pyβ βββ maddpg_evaluation.pyβββ mappo/ # Flat MAPPOβ βββ mappo_train.pyβ βββ mappo_evaluation.pyβββ meanfield/ # Flat MeanField Actor-Critic (MFAC)β βββ meanfield_train.pyβ βββ meanfield_evaluation.pyβββ PG/ # Policy Gradient (PG)β βββ pg_train.pyβ βββ pg_evaluation.pyβββ solar_sys_environment.py # Copy of the flat environment for baselines
README.md+97-1