This thesis describes an investigation into the use of multi-agent systems for automatic distributed control of district heating systems. A district heating system is basically composed of production units, a distribution network, and a large number of consumer substations. Operators of district heating systems have several, often conflicting, goals, e.g., to satisfy customers and to minimize production costs. Current substations are purely reactive devices, making local decisions without taking into account the global state. Moreover the substations determine the flows in all parts of the district heating system. The optimal operation of the district heating system is therefore limited to providing sufficiently high temperature and pressure to all customers. The approach studied in this thesis is to equip substations with software agents to form a multi-agent system. The purpose is to dynamically control the district heating system using demand-side-management strategies. Demand-side-management are claimed to have a number of positive effects, e.g., lower production costs, reduced usage of fossil fuel, dimensioning production capacity for a lower effect/reserve alternatively with maintained dimensioning increase the number of consumers. To our knowledge this is the first work that implements automated demand-side-management strategies in district heating systems. The fundamental idea behind the approach is that a large number of local decisions with apparently small impact, together have large impact on the overall system performance without reducing the quality of service delivered. In order to evaluate the approach, a fine-grained simulation tool that simulates a complete district heating system was built. This work included the development of novel simulation models, often by integrating existing ones. The simulation tool simulates a district heating system second by second and dynamically supports interaction at each time step with the multi-agent system. The tool enables detailed performance analysis of both district heating systems as well as of different strategies of the control system. Results from simulation studies indicate that the approach makes it possible to reduce production while maintaining the quality of service. The study also shows that it is possible to control the trade-off between quality of service and degree of surplus production as well as the possibility of extending the system with new consumers without increasing production capacity. In another study, a experiment in a controlled physical environment, two agent-based approaches are evaluated and compared to existing technologies. The experiment shows that it is possible to automatically load balance a small district heating network using agent technology. This thesis also comprises an initial study where the strengths and weaknesses of agent-based approaches and mathematical optimization techniques are analyzed and compared. Finally, a generalized formal characterization of the problem space under investigation is provided, i.e., production and logistics network management, together with a preliminary evaluation of the applicability of the suggested multi-agent system approach for this general problem area.