Adaptive Real-Time Scheduling of Cyber-Physical Energy Systems