Safe reinforcement learning for multi-energy management systems with known constraint functions