Peak-shaving in district heating systems through optimal management of the thermal request of buildings