Intelligent district energy systems