Energy grid management system with anomaly detection and Q-learning decision modules