Exergy-efficient management of energy districts