Growing energy demands and the increased use of renewable energies have changed the landscape
of power networks leading to new challenges. Smart Grids have emerged to cope with these
challenges by facilitating the integration of traditional and renewable energy resources in distributed,
open, and self-managed ways. Innovative models are needed to design energy infrastructures that
can enable self-management of the power grid. Software architectures smoothly integrate the
software that provides self-management to Smart Grids and their hardware infrastructures. We
present a framework to design the software architectures of autonomous Smart Grids in an intuitive domain-oriented way and to simulate their execution by automatically generating the code from the designed autonomous smart grid architectures.