Enviar aquest missatge de text: Distributed optimization for structured programs and its application to energy management in a building district