A Multi-Agent Design For Smart Distribution Automation System With Distributed Energy Resources And Microgrids