ML-Driven Rolling Horizon Optimization
Combining LSTM-based deep learning forecasting with Stackelberg game theory for data-driven building-to-building energy exchange decisions.
Rolling Horizon LSTM-Based B2B Optimization
This research combines the predictive capability of LSTM-based machine learning with Stackelberg game theory to create a rolling-horizon energy exchange optimisation system. Buildings make informed, profitable trading decisions by forecasting PV generation and load demand 24 hours ahead — adapting in real time to dynamic building energy patterns.
How the Forecasting Works
An encoder-decoder sequential LSTM model with multiple layers generates 15-minute and 1-hour resolution forecasts of PV generation and load demand for each building. The model uses a sliding window approach with customisable look-back periods — recognising that each building has unique energy patterns requiring tailored hyperparameters.
Forecasting Performance
Hyperparameter Tuning
Each building receives a customised LSTM configuration: look-back window, layer count, learning rate, and forecast sequence length are individually optimised via grid search, achieving significantly lower MAPE than one-size-fits-all approaches.
Load & PV Forecasting
Buildings 1 and 4 exhibit higher loads and greater variability, while Building 3 has a more consistent pattern (lowest MAPE: 6.07%). PV forecasting uses post-processing to replace nighttime values with zero, achieving high accuracy for the critical 24-hour ahead window.
Rolling Horizon Energy Exchange Results
The proposed model is compared against three scenarios: game theory without forecasting, with LSTM forecasting, and with perfect (100%) forecasting. As prediction accuracy improves, energy costs decrease — validating the critical role of ML in B2B trading.
Key Performance Metrics
Sensitivity & Scalability
ESS Capacity Impact
The sensitivity analysis examines ESS capacities from 20 to 100 kWh. Higher capacities increase B2B autonomy and reduce grid dependence, but moderate capacities (60–80 kWh) offer the best balance between cost savings and investment return.
Network Scalability
Tested from 4 to 32 buildings, execution time scales from 1.26 to 14.35 seconds — demonstrating practical feasibility for real-time B2B market operation. B2B energy exchange and ESS utilisation increase proportionally while maintaining consistent per-building savings.