Integrated Demand-side and Production Optimization of Complex District Heating and Cooling Networks